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
This commit is contained in:
parent
7a132fc676
commit
db57ab1c97
4 changed files with 50 additions and 0 deletions
|
@ -59,6 +59,15 @@ INSTALLATION:
|
|||
## start the first time by hand
|
||||
/etc/rc.d/init.d/ddclient start
|
||||
|
||||
## For those using Alpine style rc files and using daemon-mode:
|
||||
cp sample-etc_rc.d_init.d_ddclient.alpine /etc/init.d/ddclient
|
||||
## enable automatic startup when booting
|
||||
rc-update add ddclient
|
||||
## make sure you have perl installed
|
||||
apk add perl
|
||||
## start the first time by hand
|
||||
rc-service ddclient start
|
||||
|
||||
## If you are not using daemon-mode, configure cron and dhcp or ppp
|
||||
## as described below.
|
||||
|
||||
|
|
|
@ -6,5 +6,7 @@ you have IO::Socket::SSL.
|
|||
|
||||
On debian, you need libio-socket-ssl-perl to have IO::Socket::SSL
|
||||
|
||||
On alpine, you need perl-io-socket-ssl to have IO::Socket::SSL
|
||||
|
||||
ssl support is tested on folowing dynamic dns providers:
|
||||
- dyndns.com
|
||||
|
|
1
ddclient
1
ddclient
|
@ -1784,6 +1784,7 @@ sub load_ssl_support {
|
|||
Error loading the Perl module IO::Socket::SSL needed for SSL connect.
|
||||
On Debian, the package libio-socket-ssl-perl must be installed.
|
||||
On Red Hat, the package perl-IO-Socket-SSL must be installed.
|
||||
On Alpine, the package perl-io-socket-ssl must be installed.
|
||||
EOM
|
||||
}
|
||||
import IO::Socket::SSL;
|
||||
|
|
38
sample-etc_rc.d_init.d_ddclient.alpine
Executable file
38
sample-etc_rc.d_init.d_ddclient.alpine
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/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 $?
|
||||
}
|
Loading…
Reference in a new issue