]> git.pld-linux.org Git - packages/ddclient.git/blame - ddclient.init
- updated to 3.6.5
[packages/ddclient.git] / ddclient.init
CommitLineData
68b71e41
AM
1#!/bin/sh
2#
3# ddclient ddclient (secure shell daemon)
4#
5# chkconfig: 345 55 45
6#
7# description: ddclient - dynamic dns client
8
9
10# Source function library
11. /etc/rc.d/init.d/functions
12
13# Get network config
14. /etc/sysconfig/network
15
16# Get service config
17[ -f /etc/sysconfig/ddclient ] && . /etc/sysconfig/ddclient
18
19# Check that networking is up.
20if is_yes "${NETWORKING}"; then
f0ef2620 21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
68b71e41
AM
22 msg_network_down "Dynamic DNS Client"
23 exit 1
24 fi
25else
26 exit 0
27fi
28
27a548de 29RETVAL=0
68b71e41
AM
30# See how we were called.
31case "$1" in
32 start)
33 # Check if the service is already running?
34 if [ ! -f /var/lock/subsys/ddclient ]; then
35 msg_starting "Dynamic DNS Client"
36 daemon /usr/sbin/ddclient -daemon 300
37 RETVAL=$?
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ddclient
39 else
40 msg_already_running "Dynamic DNS Client"
41 fi
42 ;;
43 stop)
44 if [ -f /var/lock/subsys/ddclient ]; then
45 msg_stopping "Dynamic DNS Client"
46 killproc ddclient
47 rm -f /var/run/ddclient.pid /var/lock/subsys/ddclient >/dev/null 2>&1
48 else
49 msg_not_running "Dynamic DNS Client"
68b71e41
AM
50 fi
51 ;;
52 restart)
53 $0 stop
54 $0 start
27a548de 55 exit $?
68b71e41
AM
56 ;;
57 status)
58 status ddclient
59 exit $?
60 ;;
27a548de 61 reload|force-reload)
68b71e41
AM
62 if [ -f /var/lock/subsys/ddclient ]; then
63 msg_reloading "Dynamic DNS Client"
64 killproc ddclient -HUP
65 RETVAL=$?
66 else
27a548de 67 msg_not_running "Dynamic DNS Client" >&2
68 exit 7
68b71e41
AM
69 fi
70 ;;
71 *)
27a548de 72 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
73 exit 3
68b71e41
AM
74esac
75
76exit $RETVAL
This page took 0.100834 seconds and 4 git commands to generate.