5ad049e5b3cf — Malcolm Scott 7 years ago
Correct init script
2 files changed, 11 insertions(+), 9 deletions(-)

M debian/default
M debian/init
M debian/default +3 -3
@@ 1,4 1,4 @@ 
-URL="https://nfw.example.org/enrol"
+#URL="https://nfw.example.org/enrol"
 
-BIND_ADDRESS="localhost"
-BIND_PORT="8080"
+#BIND_ADDRESS="localhost"
+#BIND_PORT="8080"

          
M debian/init +8 -6
@@ 8,16 8,18 @@ 
 # Short-Description: Trinity Hall captive portal redirector
 ### END INIT INFO
 
-# Author: Malcolm Scott <mas90@trinhall.cam.ac.uk>
+# Author: Malcolm Scott <debianpkg@malc.org.uk>
 
 # Do NOT "set -e"
 
 # PATH should only include /usr/* if it runs after the mountnfs.sh script
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="Trinity Hall captive portal redirector"
-NAME=redirector
-DAEMON=/usr/local/bin/redirector
-DAEMON_ARGS=""
+DESC="nfw captive portal redirector"
+NAME=nfw-redirector
+DAEMON=/usr/bin/nfw-redirector
+URL="https://nfw.example.org/enrol"
+BIND_ADDRESS="localhost"
+BIND_PORT="8080"
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 

          
@@ 47,7 49,7 @@ do_start()
 	start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --chuid nobody --exec $DAEMON --test > /dev/null \
 		|| return 1
 	start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --chuid nobody --exec $DAEMON -- \
-		$DAEMON_ARGS \
+		--bind-address "$BIND_ADDRESS" --bind-port "$BIND_PORT" "$URL" \
 		|| return 2
 }