Use printf instead of echo -n
[yazpp-moved-to-github.git] / src / yaz-proxy.sh
index 10fb455..757e240 100755 (executable)
@@ -18,7 +18,7 @@ DIR=/var/yaz-proxy
 DAEMON="/usr/local/bin/yaz-proxy"
 
 # Proxy PIDFILE. Must be writable by it.
-PIDFILE="$DIR/yaz-proxy.pid"
+PIDFILE="/var/run/yaz-proxy.pid"
 
 # Log file
 LOGFILE=/var/log/yaz-proxy.log
@@ -47,13 +47,13 @@ set -e
 
 case "$1" in
   start)
-       echo -n "Starting $DESC: "
+       printf "%s" "Starting $DESC: "
        cd $DIR
        $DAEMON -l $LOGFILE -p $PIDFILE $ARGS @:$PORT &
        echo "$NAME."
        ;;
   stop)
-       echo -n "Stopping $DESC: "
+       printf "%s" "Stopping $DESC: "
 
        if test -f $PIDFILE; then
                kill `cat $PIDFILE`
@@ -65,11 +65,11 @@ case "$1" in
        ;;
   reload)
        if test -f $PIDFILE; then
-               kill -INT `cat $PIDFILE`
+               kill -HUP `cat $PIDFILE`
        fi
   ;;
   restart|force-reload)
-       echo -n "Restarting $DESC: "
+       printf "%s" "Restarting $DESC: "
        if test -f $PIDFILE; then
                kill `cat $PIDFILE`
                rm -f $PIDFILE