2 # $Id: yaz-proxy.sh,v 1.2 2003-10-24 10:33:01 adam Exp $
3 # YAZ proxy start/stop init.d script.
5 PATH=/usr/local/bin:/bin:/usr/bin
8 # Proxy CWD is here. Should be writable by it.
11 DAEMON="/usr/local/bin/yaz-proxy"
13 # Proxy PIDFILE. Must be writable by it.
14 PIDFILE="/var/run/yaz-proxy.pid"
17 LOGFILE=/var/log/yaz-proxy.log
22 # Run as this user. Set to empty to keep uid as is
25 # Extra args . Config file _WITH_ option
28 if test -n "RUNAS"; then
29 ARGS="-u $RUNAS $ARGS"
32 # Name, Description (not essential)
36 test -d $DIR || exit 0
37 test -f $DAEMON || exit 0
43 printf "%s" "Starting $DESC: "
45 $DAEMON -l $LOGFILE -p $PIDFILE $ARGS @:$PORT &
49 printf "%s" "Stopping $DESC: "
51 if test -f $PIDFILE; then
56 echo "No PID $PIDFILE"
60 if test -f $PIDFILE; then
61 kill -HUP `cat $PIDFILE`
65 printf "%s" "Restarting $DESC: "
66 if test -f $PIDFILE; then
72 $DAEMON -l $LOGFILE -p $PIDFILE $ARGS @:$PORT &
77 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
78 echo "Usage: $N {start|stop|restart|force-reload}" >&2