diff options
author | Nathan Angelacos <nangel@alpinelinux.org> | 2012-03-25 21:52:18 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-26 19:40:09 +0000 |
commit | 5adf4af4ee522cda39423372223270d84780231e (patch) | |
tree | 42b975e85af92235207cc50bf2e872e18cc2e04e /testing/wifidog/wifidog.initd | |
parent | 604d81d147a1cefbe4c1d27137dda76cdb7a52f8 (diff) | |
download | aports-5adf4af4ee522cda39423372223270d84780231e.tar.bz2 aports-5adf4af4ee522cda39423372223270d84780231e.tar.xz |
New package - wifidog embedded captive portal
new file: testing/wifidog/APKBUILD
new file: testing/wifidog/wifidog.initd
Diffstat (limited to 'testing/wifidog/wifidog.initd')
-rwxr-xr-x | testing/wifidog/wifidog.initd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/wifidog/wifidog.initd b/testing/wifidog/wifidog.initd new file mode 100755 index 0000000000..c5e3b37f08 --- /dev/null +++ b/testing/wifidog/wifidog.initd @@ -0,0 +1,39 @@ +#!/sbin/runscript +# Copyright 2012 Nathan Angelacos for Alpine Linux +# Distributed under the terms of the GNU General Public License v2 + +SVCDIR=${SVCDIR:-/etc/wifidog} +SVC=${SVCNAME#*.} +if [ -n "${SVC}" ] && [ ${SVCNAME} != "wifidog" ]; then + SVCPID="/var/run/wifidog.${SVC}.pid" +else + SVCPID="/var/run/wifidog.pid" +fi +SVCCONF="${SVCDIR}/${SVC}.conf" + +depend() { + need net + use dns +} + + +start() { + ebegin "Starting ${SVCNAME}" + + start-stop-daemon --start --exec /usr/bin/wifidog -b -m --pidfile "${SVCPID}" \ + -- -f -s -c ${SVCCONF} ${CONF} 2&>1 >/dev/null + if ! [ -d /proc/`cat ${SVCPID}` ]; then + rm -f "${SVCPID}" + eend 1 + return 1 + fi + eend 0 +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --quiet \ + --exec /usr/sbin/wifidog --pidfile "${SVCPID}" + eend $? +} + |