aports/testing/wifidog/wifidog.initd
Nathan Angelacos 5adf4af4ee New package - wifidog embedded captive portal
new file:   testing/wifidog/APKBUILD
	new file:   testing/wifidog/wifidog.initd
2012-03-26 19:40:09 +00:00

40 lines
793 B
Plaintext
Executable File

#!/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 $?
}