aboutsummaryrefslogtreecommitdiffstats
path: root/testing/noip/noip.initd
diff options
context:
space:
mode:
authorcrow <crow@linux.org.ba>2014-04-30 17:04:27 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2014-04-30 21:33:59 +0200
commitf8a81607259eb1e5396b0dc7af3f46f75624dcfa (patch)
tree67b732492039564bcbfc976b955aafa948936f67 /testing/noip/noip.initd
parentf7f16d39626ba693bff8282159f8a63bb4d52610 (diff)
downloadaports-f8a81607259eb1e5396b0dc7af3f46f75624dcfa.tar.bz2
aports-f8a81607259eb1e5396b0dc7af3f46f75624dcfa.tar.xz
testing/noip: fix init and add patched
Diffstat (limited to 'testing/noip/noip.initd')
-rw-r--r--testing/noip/noip.initd32
1 files changed, 27 insertions, 5 deletions
diff --git a/testing/noip/noip.initd b/testing/noip/noip.initd
index ff897cfb97..141c3e5a20 100644
--- a/testing/noip/noip.initd
+++ b/testing/noip/noip.initd
@@ -1,12 +1,34 @@
#!/sbin/runscript
-name=noip
-command=/usr/sbin/noip2
-command_args=$noip_args
-pidfile=$noip_pid
-
depend() {
use logger dns
need net
after firewall
}
+
+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
+ eend $? "Failed to set noip addresses to 0.0.0.0, error $?"
+ return $noip_ecode
+} \ No newline at end of file