]> git.pld-linux.org Git - packages/ntp.git/blame - ntp-client.init
- files to support indepeden installation of ntp server and client (just for sync)
[packages/ntp.git] / ntp-client.init
CommitLineData
9862853a
MK
1#!/bin/sh
2#
3# ntp This shell script takes care of starting and stopping
4# ntp (NTP client).
5#
6# chkconfig: 2345 55 10
7# description: ntp is the NTP client.
8
9# Source function library.
10. /etc/rc.d/init.d/functions
11
12# Source networking configuration.
13. /etc/sysconfig/network
14
15# Source ntp configuration
16. /etc/sysconfig/ntp
17
18# Check that networking is up.
19if is_yes "${NETWORKING}"; then
20 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
21 # nls "ERROR: Networking is down. %s can't be run." <service>
22 msg_network_down ntp
23 exit 1
24 fi
25else
26 exit 0
27fi
28
29[ -x /usr/sbin/ntpdate ] || exit 0
30
31RETVAL=0
32# See how we were called.
33case "$1" in
34 start)
35 if is_yes "$SYNC_TIME"; then
36 # Adjust time
37 run_cmd "Syncing time for ntp" "/usr/sbin/ntpdate $NTPDATE_OPTIONS $NTPDATE_SERVERS"
38 RETVAL=$?
39 fi
40 ;;
41 stop)
42 exit $RETVAL
43 ;;
44 restart|force-reload)
45 $0 start
46 exit $?
47 ;;
48 *)
49 msg_usage "$0 {start|restart|force-reload}"
50 exit 3
51esac
52
53exit $RETVAL
This page took 0.034971 seconds and 4 git commands to generate.