[Pkg-voip-commits] r10626 - in /stun/trunk/debian: changelog stun-server.stun.init

kilian at alioth.debian.org kilian at alioth.debian.org
Mon Dec 22 00:22:04 UTC 2014


Author: kilian
Date: Mon Dec 22 00:21:46 2014
New Revision: 10626

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=10626
Log:
Fix init script PID file location and make variable handling somewhat more
robust

Modified:
    stun/trunk/debian/changelog
    stun/trunk/debian/stun-server.stun.init

Modified: stun/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/stun/trunk/debian/changelog?rev=10626&op=diff
==============================================================================
--- stun/trunk/debian/changelog	(original)
+++ stun/trunk/debian/changelog	Mon Dec 22 00:21:46 2014
@@ -1,8 +1,9 @@
 stun (0.97~dfsg-2) UNRELEASED; urgency=medium
 
-  * Fix init script PID file
+  * Fix init script PID file location and make variable handling somewhat more
+    robust
 
- -- Kilian Krause <kilian at debian.org>  Mon, 22 Dec 2014 00:37:10 +0100
+ -- Kilian Krause <kilian at debian.org>  Mon, 22 Dec 2014 01:19:45 +0100
 
 stun (0.97~dfsg-1) unstable; urgency=medium
 

Modified: stun/trunk/debian/stun-server.stun.init
URL: http://svn.debian.org/wsvn/pkg-voip/stun/trunk/debian/stun-server.stun.init?rev=10626&op=diff
==============================================================================
--- stun/trunk/debian/stun-server.stun.init	(original)
+++ stun/trunk/debian/stun-server.stun.init	Mon Dec 22 00:21:46 2014
@@ -29,42 +29,42 @@
 if [ "$START_DAEMON" != "true" ] ; then 
 	exit 0
 fi
-if [ -z $PRIMARY_PORT ];then
+if [ -z "$PRIMARY_PORT" ];then
 	echo "No primary port given. Using default."
 	PRIMARY_PORT=3478
 fi
-if [ -z $SECONDARY_PORT ];then
+if [ -z "$SECONDARY_PORT" ];then
 	echo "No secondary port given. Using default."
 	SECONDARY_PORT=3479
 fi
-if [ -z $DAEMON_USER ];then
+if [ -z "$DAEMON_USER" ];then
 	DAEMON_USER=nobody
 fi
 
-DAEMON_OPTS="$DAEMON_OPTS -h $PRIMARY_IP -a $SECONDARY_IP -p $PRIMARY_PORT -o $SECONDARY_PORT"
+DAEMON_OPTS="-h $PRIMARY_IP -a $SECONDARY_IP -p $PRIMARY_PORT -o $SECONDARY_PORT $DAEMON_OPTS"
 
 set -e
 
 case "$1" in
   start)
-	if [ -z $PRIMARY_IP ];then
+	if [ -z "$PRIMARY_IP" ];then
 		echo "No primary IP given. Exiting."
 		exit 1
 	fi
-	if [ -z $SECONDARY_IP ];then
+	if [ -z "$SECONDARY_IP" ];then
 		echo "No secondary IP given. Exiting."
 		exit 1
 	fi
 	echo -n "Starting $DESC: "
 	start-stop-daemon --start --quiet --background --make-pidfile \
-		--pidfile $PIDFILE \
-		--chuid $DAEMON_USER --exec $DAEMON -- $DAEMON_OPTS
+		--pidfile "$PIDFILE" \
+		--chuid "$DAEMON_USER" --exec "$DAEMON" -- $DAEMON_OPTS
 	echo "$NAME."
 	;;
   stop)
 	echo -n "Stopping $DESC: "
-	start-stop-daemon --stop --quiet --pidfile $PIDFILE \
-		--oknodo --chuid $DAEMON_USER --exec $DAEMON
+	start-stop-daemon --stop --quiet --pidfile "$PIDFILE" \
+		--oknodo --chuid "$DAEMON_USER" --exec "$DAEMON"
 	echo "$NAME."
 	;;
   #reload)
@@ -80,11 +80,11 @@
 	#	$PIDFILE --exec $DAEMON
   #;;
   restart|force-reload)
-	if [ -z $PRIMARY_IP ];then
+	if [ -z "$PRIMARY_IP" ];then
 		echo "No primary IP given. Exiting."
 		exit 1
 	fi
-	if [ -z $SECONDARY_IP ];then
+	if [ -z "$SECONDARY_IP" ];then
 		echo "No secondary IP given. Exiting."
 		exit 1
 	fi
@@ -94,11 +94,9 @@
 	#	just the same as "restart".
 	#
 	echo -n "Restarting $DESC: "
-	start-stop-daemon --stop --quiet --pidfile \
-		$PIDFILE --exec $DAEMON
+	$0 stop
 	sleep 1
-	start-stop-daemon --start --quiet --pidfile \
-		$PIDFILE --exec $DAEMON -- $DAEMON_OPTS
+	$0 start
 	echo "$NAME."
 	;;
   status)
@@ -118,7 +116,7 @@
        fi
        ;;
   *)
-	N=/etc/init.d/$NAME
+	N="/etc/init.d/$NAME"
 	# echo "Usage: $N {start|stop|restart|status|reload|force-reload}" >&2
 	echo "Usage: $N {start|stop|restart|status|force-reload}" >&2
 	exit 1




More information about the Pkg-voip-commits mailing list