Benjamin Renard commited on 2012-01-10 12:49:31
Showing 6 changed files, with 81 additions and 5 deletions.
| ... | ... |
@@ -1,4 +1,11 @@ |
| 1 |
-wifidog-gateway (svn.r1461) unstable; urgency=low |
|
| 1 |
+wifidog-gateway (svn.r1461-2) unstable; urgency=low |
|
| 2 |
+ |
|
| 3 |
+ * Fix wifidog binary source |
|
| 4 |
+ * Add a Debian style init.d script |
|
| 5 |
+ |
|
| 6 |
+ -- Benjamin Renard <brenard@zionetrix.net> Tue, 10 Jan 2012 12:13:25 +0100 |
|
| 7 |
+ |
|
| 8 |
+wifidog-gateway (svn.r1461-1) unstable; urgency=low |
|
| 2 | 9 |
|
| 3 | 10 |
* Initial Debian release |
| 4 | 11 |
|
| ... | ... |
@@ -46,7 +46,6 @@ install: build |
| 46 | 46 |
# Add here commands to install the package into debian/wifidog-gateway. |
| 47 | 47 |
cp $(CURDIR)/wifidog.conf $(CURDIR)/debian/wifidog-gateway/etc |
| 48 | 48 |
cp $(CURDIR)/wifidog-msg.html $(CURDIR)/debian/wifidog-gateway/etc |
| 49 |
- cp $(CURDIR)/scripts/init.d/wifidog $(CURDIR)/debian/wifidog-gateway/etc/init.d |
|
| 50 | 49 |
|
| 51 | 50 |
cp $(CURDIR)/src/wdctl $(CURDIR)/debian/wifidog-gateway/usr/bin |
| 52 | 51 |
cp $(CURDIR)/src/.libs/wifidog $(CURDIR)/debian/wifidog-gateway/usr/bin |
| ... | ... |
@@ -79,7 +78,7 @@ binary-arch: build install |
| 79 | 78 |
# dh_installpam |
| 80 | 79 |
# dh_installmime |
| 81 | 80 |
# dh_python |
| 82 |
-# dh_installinit |
|
| 81 |
+ dh_installinit |
|
| 83 | 82 |
# dh_installcron |
| 84 | 83 |
# dh_installinfo |
| 85 | 84 |
dh_installman |
| ... | ... |
@@ -0,0 +1,11 @@ |
| 1 |
+# Enable Wifidog Gateway (yes/no) |
|
| 2 |
+#WIFIDOG_ENABLED=yes |
|
| 3 |
+ |
|
| 4 |
+# Wifidog Gateway configuration file |
|
| 5 |
+#DAEMON_CONF=/etc/wifidog.conf |
|
| 6 |
+ |
|
| 7 |
+# Log level (0=emerg, 1=alert, 2=crit, 3=err, 4=warn, 5=notice, 6=info, 7=debug) |
|
| 8 |
+#LOG_LEVEL=6 |
|
| 9 |
+ |
|
| 10 |
+# Options appended to the wifidog command-line |
|
| 11 |
+#OPTIONS="" |
| ... | ... |
@@ -0,0 +1,57 @@ |
| 1 |
+#!/bin/sh |
|
| 2 |
+### BEGIN INIT INFO |
|
| 3 |
+# Provides: wifidog-gateway |
|
| 4 |
+# Required-Start: $local_fs $remote_fs $network $syslog $named |
|
| 5 |
+# Required-Stop: $local_fs $remote_fs $network $syslog $named |
|
| 6 |
+# Default-Start: 2 3 4 5 |
|
| 7 |
+# Default-Stop: 0 1 6 |
|
| 8 |
+# X-Interactive: true |
|
| 9 |
+# Short-Description: Start/stop wifidog gateway daemon |
|
| 10 |
+### END INIT INFO |
|
| 11 |
+ |
|
| 12 |
+DAEMON_BIN=/usr/bin/wifidog |
|
| 13 |
+WDCTL_BIN=/usr/bin/wdctl |
|
| 14 |
+DAEMON_DEFS=/etc/default/wifidog-gateway |
|
| 15 |
+DAEMON_CONF=/etc/wifidog.conf |
|
| 16 |
+LOG_LEVEL=6 |
|
| 17 |
+OPTIONS="" |
|
| 18 |
+NAME=wifidog-gateway |
|
| 19 |
+DESC="Wifidog Gateway" |
|
| 20 |
+ |
|
| 21 |
+[ -x "$DAEMON_BIN" ] || exit 0 |
|
| 22 |
+[ -s "$DAEMON_DEFS" ] && . $DAEMON_DEFS |
|
| 23 |
+[ ! -r "$DAEMON_CONF" ] && echo "Configuration file $DAEMON_CONF not present or unreadable" && exit 0 |
|
| 24 |
+[ "$WIFIDOG_ENABLED" != "yes" ] && echo "$NAME disabled. see /etc/default/wifidog-gateway." && exit 0 |
|
| 25 |
+ |
|
| 26 |
+DAEMON_OPTS="-c $DAEMON_CONF -s -d $LOG_LEVEL" |
|
| 27 |
+ |
|
| 28 |
+. /lib/lsb/init-functions |
|
| 29 |
+ |
|
| 30 |
+case "$1" in |
|
| 31 |
+ start) |
|
| 32 |
+ log_daemon_msg "Starting $DESC" "$NAME" |
|
| 33 |
+ start-stop-daemon --start --oknodo --quiet --exec "$DAEMON_BIN" -- $DAEMON_OPTS |
|
| 34 |
+ log_end_msg "$?" |
|
| 35 |
+ ;; |
|
| 36 |
+ stop) |
|
| 37 |
+ log_daemon_msg "Stopping $DESC" "$NAME" |
|
| 38 |
+ start-stop-daemon --stop --oknodo --quiet --exec "$DAEMON_BIN" |
|
| 39 |
+ log_end_msg "$?" |
|
| 40 |
+ ;; |
|
| 41 |
+ restart|reload|force-reload) |
|
| 42 |
+ $0 stop |
|
| 43 |
+ sleep 2 |
|
| 44 |
+ $0 start |
|
| 45 |
+ ;; |
|
| 46 |
+ status) |
|
| 47 |
+ $WDCTL_BIN status |
|
| 48 |
+ exit $? |
|
| 49 |
+ ;; |
|
| 50 |
+ *) |
|
| 51 |
+ N=/etc/init.d/$NAME |
|
| 52 |
+ echo "Usage: $N {start|stop|restart|force-reload|reload|status}" >&2
|
|
| 53 |
+ exit 1 |
|
| 54 |
+ ;; |
|
| 55 |
+esac |
|
| 56 |
+ |
|
| 57 |
+exit 0 |
|
| 0 | 58 |