ddclient/sample-etc_rc.d_init.d_ddclient.alpine
wimpunk db57ab1c97 Added Alpine Linux init script
Patch send by Tal on github.


git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/trunk@161 3873ddee-7413-0410-b6c4-c2c57c1ab35a
2014-03-20 20:02:14 +00:00

38 lines
795 B
Text
Executable file

#!/sbin/runscript
description="ddclient Daemon for Alpine"
command="/usr/sbin/ddclient"
config_file="/etc/ddclient/ddclient.conf"
command_args=""
pidfile=$(grep -v '^\s*#' "${config_file}" | grep -i -m 1 pid= | awk -F '=' '{print $2}')
delay=$(grep -v '^\s*#' "${config_file}" | grep -i -m 1 "daemon" | awk -F '=' '{print $2}')
if [ -z "${delay}" ]
then
command_args="-daemon 300"
else
command_args=""
fi
depend() {
use logger
need net
after firewall
}
start() {
ebegin "Starting ddclient"
start-stop-daemon --start \
--exec "${command}" \
--pidfile "${pidfile}" \
-- \
${command_args}
eend $?
}
stop() {
ebegin "Stopping ddclient"
start-stop-daemon --stop --exec "${command}" \
--pidfile "${pidfile}"
eend $?
}