]> git.pld-linux.org Git - packages/noip.git/blob - noip.init
executable
[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 [ ! -s /etc/noip.conf ]; then
27                 echo "You should first run $0 config to prepare configuration";
28                 exit 3
29         fi
30         if [ ! -f /var/lock/subsys/noip ]; then
31                 msg_starting noip
32                 daemon noip $OPTIONS
33                 RETVAL=$?
34                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/noip
35         else
36                 msg_already_runing noip
37         fi
38 }
39
40 stop() {
41         if [ -f /var/lock/subsys/noip ]; then
42                 msg_stopping noip
43                 killproc noip
44                 rm -f /var/lock/subsys/noip > /dev/null 2>&1
45         else
46                 msg_not_running noip
47         fi
48 }
49
50 RETVAL=0
51 case "$1" in
52   start)
53         start
54         ;;
55   stop)
56         stop
57         ;;
58   restart)
59         stop
60         start
61         ;;
62   config|status)
63         noip -C
64         noip -S
65         ;;
66   *)
67         msg_usage "$0 {start|stop|restart|config|status}"
68         exit 3
69         ;;
70 esac
71
72 exit $RETVAL
This page took 0.062443 seconds and 3 git commands to generate.