home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: Special Survival Kit
/
Chip_Special_Survival_Kit_fuer_PC_Anwender.iso
/
PaperOut
/
NEXTSTEP
/
PaperOut.app
/
licenceManager
< prev
next >
Wrap
Text File
|
1994-03-29
|
2KB
|
102 lines
#!/bin/sh
HOSTID="hostid"
HOST="localhost"
ARG=""
#
LOCATION="/usr/paperout"
ETHERADDR="bin/etheraddr"
DAEMON="bin/licenced"
LICENCES="etc/licences"
STAT=0
DOEXIT=0
VALUE=0
PARSEMODE="error"
CMDMODE="error"
USAGE="usage: $0 [-host hostname] [-path pathname] -id | -start | -ether"
while [ $# -gt 0 ]; do
F="$1"
case $F in
-id )
CMDMODE="id"
PARSEMODE="id"
;;
-host )
PARSEMODE="host"
;;
-path )
PARSEMODE="path"
;;
-start )
CMDMODE="start"
;;
-ether )
echo $LOCATION/bin
exit 0
;;
* )
case $PARSEMODE in
id )
ARG=$F
;;
host )
HOST=$F
;;
path )
LOCATION=$F
;;
* )
echo $USAGE 1>&2
exit 1
;;
esac
;;
esac
shift
done
[ $DOEXIT -ne 0 -o $STAT -ne 0 ] && exit $STAT
case $CMDMODE in
id )
if [ $HOST = `hostname` -o $HOST = "localhost" -o $HOST = "" ]; then
CMD1="$HOSTID"
CMD2="$LOCATION/$ETHERADDR $ARG"
else
CMD1="rsh $HOST -n $HOSTID"
CMD2="rsh $HOST -n $LOCATION/$ETHERADDR $ARG"
fi
VALUE=`$CMD1`
STAT=$?
if [ $STAT -eq 0 ]; then
if [ "$VALUE" = "" -o "$VALUE" = "0x0" ]; then
VALUE=`$CMD2`
STAT=$?
[ $STAT -ne 0 ] && exit $STAT
echo $VALUE
else
echo $VALUE
fi
fi
;;
start )
if [ $HOST = `hostname` -o $HOST = "localhost" -o $HOST = "" ]; then
CMD1="$LOCATION/$DAEMON $LOCATION/$LICENCES"
else
CMD1="rsh $HOST -n $LOCATION/$DAEMON $LOCATION/$LICENCES"
fi
$CMD1
[ $STAT -ne 0 ] && exit $STAT
;;
* )
echo $USAGE 1>&2
exit 1
;;
esac
[ $DOEXIT -ne 0 -o $STAT -ne 0 ] && exit $STAT
exit 0