+

Release svn.r1461-2

Benjamin Renard [2012-01-10 12:49:31]
Release svn.r1461-2
Filename
.gitignore
changelog
dirs
rules
wifidog-gateway.default
wifidog-gateway.init
diff --git a/.gitignore b/.gitignore
index 4824426..74d4d4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
 files
-wifidog-gateway*
+wifidog-gateway.debhelper.log
+wifidog-gateway.substvars
+wifidog-gateway/
+*.debhelper
 *~
diff --git a/changelog b/changelog
index 0fb5b72..ab578dc 100644
--- a/changelog
+++ b/changelog
@@ -1,4 +1,11 @@
-wifidog-gateway (svn.r1461) unstable; urgency=low
+wifidog-gateway (svn.r1461-2) unstable; urgency=low
+
+  * Fix wifidog binary source
+  * Add a Debian style init.d script
+
+ -- Benjamin Renard <brenard@zionetrix.net>  Tue, 10 Jan 2012 12:13:25 +0100
+
+wifidog-gateway (svn.r1461-1) unstable; urgency=low

   * Initial Debian release

diff --git a/dirs b/dirs
index 5345a9b..4fb0f1a 100644
--- a/dirs
+++ b/dirs
@@ -1,5 +1,4 @@
 etc
-etc/init.d
 usr/bin
 usr/include/wifidog
 usr/lib
diff --git a/rules b/rules
index df03fa1..470bc28 100755
--- a/rules
+++ b/rules
@@ -46,7 +46,6 @@ install: build
 	# Add here commands to install the package into debian/wifidog-gateway.
 	cp $(CURDIR)/wifidog.conf $(CURDIR)/debian/wifidog-gateway/etc
 	cp $(CURDIR)/wifidog-msg.html $(CURDIR)/debian/wifidog-gateway/etc
-	cp $(CURDIR)/scripts/init.d/wifidog $(CURDIR)/debian/wifidog-gateway/etc/init.d

 	cp $(CURDIR)/src/wdctl $(CURDIR)/debian/wifidog-gateway/usr/bin
 	cp $(CURDIR)/src/.libs/wifidog $(CURDIR)/debian/wifidog-gateway/usr/bin
@@ -79,7 +78,7 @@ binary-arch: build install
 #	dh_installpam
 #	dh_installmime
 #	dh_python
-#	dh_installinit
+	dh_installinit
 #	dh_installcron
 #	dh_installinfo
 	dh_installman
diff --git a/wifidog-gateway.default b/wifidog-gateway.default
new file mode 100644
index 0000000..ca668b8
--- /dev/null
+++ b/wifidog-gateway.default
@@ -0,0 +1,11 @@
+# Enable Wifidog Gateway (yes/no)
+#WIFIDOG_ENABLED=yes
+
+# Wifidog Gateway configuration file
+#DAEMON_CONF=/etc/wifidog.conf
+
+# Log level (0=emerg, 1=alert, 2=crit, 3=err, 4=warn, 5=notice, 6=info, 7=debug)
+#LOG_LEVEL=6
+
+# Options appended to the wifidog command-line
+#OPTIONS=""
diff --git a/wifidog-gateway.init b/wifidog-gateway.init
new file mode 100755
index 0000000..7316558
--- /dev/null
+++ b/wifidog-gateway.init
@@ -0,0 +1,57 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:	    wifidog-gateway
+# Required-Start:    $local_fs $remote_fs $network $syslog $named
+# Required-Stop:     $local_fs $remote_fs $network $syslog $named
+# Default-Start:     2 3 4 5
+# Default-Stop:	0 1 6
+# X-Interactive:     true
+# Short-Description: Start/stop wifidog gateway daemon
+### END INIT INFO
+
+DAEMON_BIN=/usr/bin/wifidog
+WDCTL_BIN=/usr/bin/wdctl
+DAEMON_DEFS=/etc/default/wifidog-gateway
+DAEMON_CONF=/etc/wifidog.conf
+LOG_LEVEL=6
+OPTIONS=""
+NAME=wifidog-gateway
+DESC="Wifidog Gateway"
+
+[ -x "$DAEMON_BIN" ] || exit 0
+[ -s "$DAEMON_DEFS" ] && . $DAEMON_DEFS
+[ ! -r "$DAEMON_CONF" ] && echo "Configuration file $DAEMON_CONF not present or unreadable" && exit 0
+[ "$WIFIDOG_ENABLED" != "yes" ] && echo "$NAME disabled. see /etc/default/wifidog-gateway." && exit 0
+
+DAEMON_OPTS="-c $DAEMON_CONF -s -d $LOG_LEVEL"
+
+. /lib/lsb/init-functions
+
+case "$1" in
+	start)
+		log_daemon_msg "Starting $DESC" "$NAME"
+		start-stop-daemon --start --oknodo --quiet --exec "$DAEMON_BIN" -- $DAEMON_OPTS
+		log_end_msg "$?"
+		;;
+	stop)
+		log_daemon_msg "Stopping $DESC" "$NAME"
+		start-stop-daemon --stop --oknodo --quiet --exec "$DAEMON_BIN"
+		log_end_msg "$?"
+		;;
+	restart|reload|force-reload)
+		$0 stop
+		sleep 2
+		$0 start
+		;;
+	status)
+		$WDCTL_BIN status
+		exit $?
+		;;
+	*)
+		N=/etc/init.d/$NAME
+		echo "Usage: $N {start|stop|restart|force-reload|reload|status}" >&2
+		exit 1
+		;;
+esac
+
+exit 0
ViewGit