]> git.pld-linux.org Git - packages/noip.git/blob - noip.init
adjust for file rename
[packages/noip.git] / noip.init
1 #!/bin/sh
2 #
3 # nopi          Start/Stop the no-ip.com client.
4 #
5 # chkconfig:    2345 15 89
6 #
7 # description:  When configured correctly, the client will check your IP \
8 #               address at a given time interval checking to see if your IP \
9 #               has changed. If your IP address has changed it will notify \
10 #               No-IP DNS servers and update the IP corresponding to your \
11 #               No-IP/No-IP+ hostname.
12 #
13 # processname:  noip
14 # config:       /etc/noip
15 # pidfile:      /var/run/noip.pid # don't know if it's true
16
17 # Source function library
18 . /etc/rc.d/init.d/functions
19
20 # Source noip configuration.
21 if [ -f /etc/sysconfig/noip ]; then
22         . /etc/sysconfig/noip
23 fi
24
25 start() {
26         if [ -f /var/lock/subsys/noip ]; then
27                 msg_already_running noip
28                 return
29         fi
30
31         if [ ! -s /etc/noip.conf ]; then
32                 echo "You should first run $0 config to prepare configuration";
33                 exit 3
34         fi
35
36         msg_starting noip
37         daemon /usr/sbin/noip $OPTIONS
38         RETVAL=$?
39         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/noip
40 }
41
42 stop() {
43         if [ ! -f /var/lock/subsys/noip ]; then
44                 msg_not_running noip
45                 return
46         fi
47
48         msg_stopping noip
49         killproc noip
50         rm -f /var/lock/subsys/noip > /dev/null 2>&1
51 }
52
53 RETVAL=0
54 case "$1" in
55   start)
56         start
57         ;;
58   stop)
59         stop
60         ;;
61   restart)
62         stop
63         start
64         ;;
65   config|status)
66         noip -C
67         noip -S
68         ;;
69   *)
70         msg_usage "$0 {start|stop|restart|config|status}"
71         exit 3
72         ;;
73 esac
74
75 exit $RETVAL
This page took 0.134819 seconds and 4 git commands to generate.