diff options
author | Martin Väth <martin@mvath.de> | 2016-01-03 11:45:14 +0100 |
---|---|---|
committer | Martin Väth <martin@mvath.de> | 2016-01-03 11:45:14 +0100 |
commit | 126b94a63ea6a4f41878993a5d727b50daeacee3 (patch) | |
tree | da0ef8ef08897c37ed6275dde00bac91623a9437 /net-dns/noip-updater/files/noip2.start | |
parent | app-shells/zsh: Make repoman happy (diff) | |
download | mv-126b94a63ea6a4f41878993a5d727b50daeacee3.tar.gz mv-126b94a63ea6a4f41878993a5d727b50daeacee3.tar.bz2 mv-126b94a63ea6a4f41878993a5d727b50daeacee3.zip |
net-dns/noip-updater: Copy from gentoo repository to save from removal.
Bump to EAPI=6. Support optionally user ez-ipupd instead of nobody.
Fix initscript: runscript->openrc-run, avoid bashism.
Diffstat (limited to 'net-dns/noip-updater/files/noip2.start')
-rw-r--r-- | net-dns/noip-updater/files/noip2.start | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/net-dns/noip-updater/files/noip2.start b/net-dns/noip-updater/files/noip2.start new file mode 100644 index 00000000..20723ab2 --- /dev/null +++ b/net-dns/noip-updater/files/noip2.start @@ -0,0 +1,34 @@ +#!/sbin/openrc-run + +depend() { + need localmount + need net + use dns +} + +checkconfig() { + if [ ! -f /etc/no-ip2.conf ] + then + einfo "Answer the following questions about your no-ip account." + noip2 -C || return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting noip" + start-stop-daemon --quiet --start -x /usr/sbin/noip2 -- -c /etc/no-ip2.conf + eend $? "noip did not start, error code $?" +} + +stop() { + ebegin "Stopping noip" + start-stop-daemon --quiet --stop -x /usr/sbin/noip2 + noip_ecode=$? + eend $noip_ecode "Error stopping the noip daemon, error $noip_ecode" + checkconfig || return 1 + ebegin "Setting noip addresses to 0.0.0.0" + noip2 -c /etc/no-ip2.conf -i 0.0.0.0 >/dev/null 2>&1 + eend $? "Failed to set noip addresses to 0.0.0.0, error $?" + return $noip_ecode +} |