summarylogtreecommitdiffstats
path: root/10-openntpd
blob: 1cf7cb8a2d2132254eb064a8fc716cd740442dcc (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
#!/bin/sh

if [ -e "/run/systemd/system" ]; then
    case "$2" in
        up | vpn-up)
            systemctl start openntpd.service
        ;;
        down | vpn-down)
            systemctl stop openntpd.service
        ;;
    esac
elif [ -e "/etc/rc.d/openntpd" ]; then
    case "$2" in
        up | vpn-up)
            /etc/rc.d/openntpd start
        ;;
        down | vpn-down)
            /etc/rc.d/openntpd stop
        ;;
    esac
else
    echo "Init system not detected, doing nothing!"
    exit 2
fi