]> git.pld-linux.org Git - packages/ntp.git/blame - ntp-client.init
- prefer MD5Init() from openssl libs (-lcrypto)
[packages/ntp.git] / ntp-client.init
CommitLineData
9862853a
MK
1#!/bin/sh
2#
0bcd3f32 3# ntp This shell script synchronizes time with ntpdate (NTP client)
9862853a
MK
4#
5# chkconfig: 2345 55 10
6# description: ntp is the NTP client.
7
8# Source function library.
9. /etc/rc.d/init.d/functions
10
11# Source networking configuration.
12. /etc/sysconfig/network
13
14# Source ntp configuration
15. /etc/sysconfig/ntp
16
17# Check that networking is up.
18if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
9862853a
MK
20 msg_network_down ntp
21 exit 1
22 fi
23else
24 exit 0
25fi
26
9862853a
MK
27RETVAL=0
28# See how we were called.
29case "$1" in
0bcd3f32
ER
30cronsettime)
31 is_yes "$NTPDATE_CRON" && /usr/sbin/ntpdate -s $NTPDATE_OPTIONS $NTPDATE_SERVERS > /dev/null 2>&1
81adfe42 32 RETVAL=$?
9862853a 33 ;;
0bcd3f32
ER
34start)
35 show "Syncing time with ntpdate (backgrounding)"
36 daemon --fork /usr/sbin/ntpdate -s $NTPDATE_OPTIONS $NTPDATE_SERVERS
754ad555 37 RETVAL=$?
6dce25d6 38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntp
0bcd3f32
ER
39 ;;
40stop)
6dce25d6 41 rm -f /var/lock/subsys/ntp
9862853a
MK
42 exit $RETVAL
43 ;;
0bcd3f32 44restart|force-reload)
9862853a
MK
45 $0 start
46 exit $?
47 ;;
0bcd3f32 48*)
9862853a
MK
49 msg_usage "$0 {start|restart|force-reload}"
50 exit 3
51esac
52
53exit $RETVAL
This page took 0.091099 seconds and 4 git commands to generate.