]> git.pld-linux.org Git - packages/ntp.git/blame - ntp.init
- renamed ntp.rc -> ntp.init,
[packages/ntp.git] / ntp.init
CommitLineData
b9935303 1#!/bin/sh
2#
3# ntp This shell script takes care of starting and stopping
4# ntp (NTP daemon).
5#
6# chkconfig: - 55 10
7# description: ntp is the NTP daemon.
8
9# Source function library.
10. /etc/rc.d/init.d/functions
11
12# Source networking configuration.
13. /etc/sysconfig/network
14
15# Check that networking is up.
16[ "${NETWORKING}" = "no" ] && exit 0
17
18[ -x /usr/sbin/ntpd -a -f /etc/ntp/ntp.conf ] || exit 0
19
20# See how we were called.
21case "$1" in
22 start)
23 # Check if the service is already running?
24 if [ ! -f /var/lock/subsys/ntp ]; then
25 # Adjust time to make life easy for ntp
26# echo -n "Syncing time for ntp"
27# /usr/sbin/ntpdate -o 1 clock.llnl.gov norad.arc.nasa.gov
28# echo
29 msg_starting ntp
30 daemon ntpd
31 else
32 msg_Already_Running ntp
33 exit 1
34 fi
35 touch /var/lock/subsys/ntp
36 ;;
37 stop)
38 # Stop daemons.
39 msg_stopping ntpd
40 killproc ntpd
41 rm -f /var/lock/subsys/ntp
42 ;;
43 status)
44 status ntp
45 ;;
46 restart|reload)
47 $0 stop
48 $0 start
49 ;;
50 *)
51 echo "Usage: $0 {start|stop|restart|status}"
52 exit 1
53esac
54
55exit 0
This page took 0.091762 seconds and 4 git commands to generate.