[mod.sources] v06i007: Shell Scripts for game regulator

sources-request@mirror.UUCP (06/19/86)

Submitted by: wjh12!ll-xn.ARPA!warren (Warren J. Lavallee)
Mod.sources: Volume 6, Issue 7
Archive-name: gr_scripts

	When I tried to install the game regulator that was posted
a little while ago I found out that a shell script was missing.  In the
hope a may save a few people some time I am submitting the two that I
wrote.  One is meant to be run only once and the other one installs
new versions of the program.


#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	README
#	install.sh
#	makelinks.sh
# This archive created: Thu Jun 12 22:05:48 1986
# By:	Warren J. Lavallee (ll-xn!warren)
export PATH; PATH=/bin:$PATH
echo shar: extracting "'README'" '(717 characters)'
if test -f 'README'
then
	echo shar: will not over-write existing file "'README'"
else
sed 's/^	X//' << \SHAR_EOF > 'README'
	X	Most people have already probally done this by hand or wrote
	Xthe shell script to do this-- But just in case I can save you a
	Xlittle time... here it is.
	X
	X	The two shell scripts included are for use with the
	XGame Regulator recenly posted to mod.sources.  The script called
	Xmakelinks.sh should be executed from within the games directory to
	Xmake the links for that directory.  THIS MUST BE EDITED and you
	Xmust specify the location of the Game Regulator.
	X
	XUsage:
	Xmakelinks.sh [files ...]
	X
	X	The other shell script called "install.sh" is to install
	Xnew versions of the Game Regulator.  It copys the new GR to its spot
	Xand redoes all the links.
	X
	XUsage:
	Xinstall.sh [directory links are in] [path of new GR] [path of old GR]
SHAR_EOF
if test 717 -ne "`wc -c < 'README'`"
then
	echo shar: error transmitting "'README'" '(should have been 717 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'install.sh'" '(790 characters)'
if test -f 'install.sh'
then
	echo shar: will not over-write existing file "'install.sh'"
else
sed 's/^	X//' << \SHAR_EOF > 'install.sh'
	X#!/bin/sh
	X#
	X# install.sh
	X#
	X#	This shell script is meant to install new versions of
	X#  Game Regulator into the proper directory.  
	X# 
	X#			ll-xn!warren
	X#
	X
	Xif test $# != 3; then
	X	echo "Usage: $0 (Directory) (path of new GR) (path of old GR)"
	X	exit
	Xfi
	X
	XDIR=$1
	XGR=$2
	XGRN=$3
	X
	Xif test ! -d $DIR; then
	X	echo "$DIR: non-existant"
	X	exit
	Xfi
	Xif test ! -d $DIR/.hiden; then
	X	mkdir $DIR/.hiden
	X	echo "$0: making $DIR/.hiden to hide the games in"
	Xfi
	Xif test ! -f $GR; then
	X	echo "$0: $GR: not there"
	X	exit
	Xfi
	X
	Xecho "Installing new binaries"
	Xcp $GR $GRN
	Xchgrp kmem $GRN
	Xchmod 6775 $GRN
	Xcd $DIR/.hiden
	XFILES="`/bin/ls`"
	Xcd $DIR
	Xecho $DIR
	Xecho $FILES
	Xrm -f $FILES
	X
	X
	Xecho doing links now:
	X
	Xfor i in $FILES; do
	X	echo -n $i " "
	X	if test ! -f .hiden/$i; then
	X		mv $i .hiden
	X	fi
	X	ln $GRN $DIR/$i
	Xdone
	Xecho
	Xexit 0
SHAR_EOF
if test 790 -ne "`wc -c < 'install.sh'`"
then
	echo shar: error transmitting "'install.sh'" '(should have been 790 characters)'
fi
chmod +x 'install.sh'
fi # end of overwriting check
echo shar: extracting "'makelinks.sh'" '(539 characters)'
if test -f 'makelinks.sh'
then
	echo shar: will not over-write existing file "'makelinks.sh'"
else
sed 's/^	X//' << \SHAR_EOF > 'makelinks.sh'
	X#  Written by Warren Lavallee.  For use with games regulation
	X# program.  This makes the links that the program needs to operate
	X# with.
	X
	X# The location of the Game Regulator to use
	XGR=/usr/local/games/.gr
	X
	XCWD="`pwd`"
	Xecho $CWD
	X
	Xif test ! -d .hiden; then
	X	mkdir .hiden
	X	echo "$0: made .hiden direcotry to hide games in"
	X	chmod 770 .hiden
	Xfi
	X
	Xif test ! -f $GR; then
	X	echo "Game Regulator not there"
	X	exit
	Xfi
	X
	Xecho doing links now:
	X
	Xfor i do
	X	echo -n $i " "
	X	if test ! -f .hiden/$i; then
	X		mv $i .hiden
	X	fi
	X	ln $GR $CWD/$i
	Xdone
	Xecho
	Xexit 0
SHAR_EOF
if test 539 -ne "`wc -c < 'makelinks.sh'`"
then
	echo shar: error transmitting "'makelinks.sh'" '(should have been 539 characters)'
fi
chmod +x 'makelinks.sh'
fi # end of overwriting check
#	End of shell archive
exit 0