1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#!/bin/sh
#
# Starts (and stops) the YIFF Sound System.
#
# This is *not* a Redhat restart script, however with slight modifications
# it can be.
#
# Edit paths as needed, espessially if you have customized the installation
# locations.
#
# Change the address or port number as needed (note that this
# default value is considered standard):
#
YIFFADDR=127.0.0.1:9433
# Paths (modify as needed):
#
PROGLOCK=/var/lock/subsys/yiff
PROGCFG=/usr/etc/yiffrc
YIFFSHUTDOWN=/usr/bin/yiffshutdown
case "$1" in
start)
# abort if already started
[ -f $PROGLOCK ] && exit 0
# This works only correctly if the user `nobody' is allowed
# to be in the directory where this file is called
# (for example: /root is NOT ok)
echo -n "Starting yiff: "
su nobody -c "/usr/sbin/yiff $PROGCFG &"
touch $PROGLOCK
echo "yiff"
;;
stop)
# Stop yiff.
echo -n "Shutting down yiff: "
su nobody -c "$YIFFSHUTDOWN --recorder $YIFFADDR"
rm -f $PROGLOCK
echo "yiff"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: starty {start|stop|restart}"
exit 1
esac
exit 0
|