summaryrefslogtreecommitdiffstats
path: root/package/ntp/S49ntp
blob: 35e58746b498a4c3c84264d7469f693dab7adf71 (plain)
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
#! /bin/sh

NAME=ntpd

# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
  . /etc/default/$NAME
fi

case "$1" in
  start)
    printf "Starting $NAME: "
    start-stop-daemon -S -q -x /usr/sbin/ntpd -- -g
    [ $? = 0 ] && echo "OK" || echo "FAIL"
    ;;
  stop)
    printf "Stopping $NAME: "
    start-stop-daemon -K -q -n $NAME
    [ $? = 0 ] && echo "OK" || echo "FAIL"
    ;;
  restart|reload)
    echo "Restarting $NAME: "
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|reload}" >&2
    exit 1
    ;;
esac

exit 0
OpenPOWER on IntegriCloud