summaryrefslogtreecommitdiff
path: root/packages/openntpd/files/init
blob: d35c65299d363426f671f28707b2fc89bbd7c507 (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
35
36
37
#! /bin/sh 
#
# This is an init script for openembedded
# Copy it to /etc/init.d/samba and type
# > update-rc.d init defaults 61
#

ntpd=/usr/sbin/ntpd
test -x "$ntpd" || exit 0
[ ! -d /var/shared/empty ] && mkdir /var/shared/empty

case "$1" in
  start)
    echo "Starting openntpd"
    start-stop-daemon --start --quiet --exec $ntpd -- -s
    ;;
  stop)
    echo "Stopping openntpd"
    start-stop-daemon --stop --quiet --exec $ntpd
    ;;
  reload|force-reload)
    echo "Reloading openntpd"
    start-stop-daemon --stop --quiet --signal 1 --exec $ntpd
    ;;
  restart)
    echo "Stopping openntpd"
    start-stop-daemon --stop --quiet --exec $ntpd
    sleep 1
    echo "Starting openntpd"
    start-stop-daemon --start --quiet --exec $ntpd -- -s
    ;;
  *)
    echo "Usage: /etc/init.d/openntpd {start|stop|reload|restart|force-reload}"
    exit 1
esac

exit 0