-
Notifications
You must be signed in to change notification settings - Fork 0
/
redhat.noip.sh
76 lines (67 loc) · 1.25 KB
/
redhat.noip.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
#
# chkconfig: 345 99 80
# description: Starts and stops the no-ip.com Dynamic dns client daemon
#
# pidfile: /var/run/noipd.pid
#
# Written by [email protected] and tested on Redhat 8
# ... and debugged by Uwe Dippel
# 29-03-2003
#
# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
# Avoid using root's TMPDIR
unset TMPDIR
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
RETVAL=0
start() {
if [ -f /var/run/noipd.pid ] ; then
echo "no-ip client daemon already started" && exit 0
fi
echo -n $"Starting no-ip client daemon: "
daemon /usr/local/bin/noip2
echo
RETVAL=$?
/sbin/pidof noip2 > /var/run/noipd.pid
}
stop() {
if [ -f /var/run/noipd.pid ] ; then
echo -n $"Stopping no-ip client daemon: "
killproc noip2 -TERM
echo
RETVAL=$?
rm -f /var/run/noipd.pid
else
echo "no-ip client daemon is not running" && exit 0
fi
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?