diff options
author | Eivind Uggedal <eivind@uggedal.com> | 2014-05-31 09:44:50 +0000 |
---|---|---|
committer | Eivind Uggedal <eivind@uggedal.com> | 2014-05-31 09:44:50 +0000 |
commit | 037339bec8822fe30328c48fe7b109f3ed6dbebb (patch) | |
tree | 8e97c945f80316521bc4b71371cc988842bdace3 /unmaintained/wifidog/wifidog.initd | |
parent | b3eb04ef635daf400e10e118e0c19d872f438a39 (diff) | |
download | aports-037339bec8822fe30328c48fe7b109f3ed6dbebb.tar.bz2 aports-037339bec8822fe30328c48fe7b109f3ed6dbebb.tar.xz |
testing/wifidog: move to unmaintained
Diffstat (limited to 'unmaintained/wifidog/wifidog.initd')
-rwxr-xr-x | unmaintained/wifidog/wifidog.initd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/unmaintained/wifidog/wifidog.initd b/unmaintained/wifidog/wifidog.initd new file mode 100755 index 0000000000..c5e3b37f08 --- /dev/null +++ b/unmaintained/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 $? +} + |