Adaptation of the script presented in Autoboot_of_SQL_Server for a DEC 3000/300 running DIGITAL UNIX 3.2c. There were a few typos and changes that were needed. Some comments were removed to improve readability ;) If you need them see the original.
Wouldn't it be nice if isql permitted a command line script
like some of the standard unix utilities?
#!/bin/sh
USAGE="Usage: /sbin/init.d/sybase {start | stop}"
SYBASE=/sybase
DSQUERY=SERVER_NAME
PASSWD=*********
RUNSERVER=RUN_SERVER_NAME
OUTFILE=./out
if [ $# -lt 1 ]
then
echo "$USAGE"
exit 1
fi
export SYBASE
case $1 in
'start')
echo start sybase
nohup $SYBASE/install/startserver -f $SYBASE/install/$RUNSERVER >$OUTFILE&
;;
'stop')
echo stop sybase
$SYBASE/bin/isql -S$DSQUERY -Usa -P$PASSWD <<!
shutdown with nowait
go
!
;;
*)
echo $USAGE
exit 1
;;
esac
exit 0