summaryrefslogtreecommitdiff
blob: 992e19924642ee6b215466833d93e6b660ae3f25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /sbin/runscript

depend() {
	need localmount
	need net
}

start() {
	if [ ! -f /etc/no-ip.conf ]
	then
		einfo "Answer the following questions about your no-ip account."
		cd /tmp
		(no-ip.sh && mv no-ip.conf /etc/no-ip.conf) || eend 1
		ln -s /etc/no-ip.conf /usr/lib/no-ip.conf >& /dev/null
	fi
	ebegin "Starting noip"
	noip -c /etc/no-ip.conf
	eend $? "noip did not start, error code $?"
}

stop() {
	ebegin "Stopping noip"
	kill `ps -A | grep noip | awk '{print $1}'` >& /dev/null 
	eend $? "Either noip did not start or there was a problem stopping" 
	ebegin "Setting noip addresses to 0.0.0.0"
	noip -c /etc/no-ip.conf -i 0.0.0.0
	eend $? "Failed to set noip addresses to 0.0.0.0"
}