summarylogtreecommitdiffstats
path: root/10-ntpd
blob: 9f2e528ae21093fc9be00ed32e5546fed2818853 (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/bash
     
    if [ -e /sys/fs/cgroup/systemd ]; then
            case "$2" in
                    up)
                            systemctl start systemd-timedated-ntp.target
                    ;;
                    vpn-up)
                            systemctl start systemd-timedated-ntp.target
                    ;;
                    down)
                            systemctl stop systemd-timedated-ntp.target
                    ;;
                    vpn-down)
                            systemctl stop systemd-timedated-ntp.target
                    ;;
            esac
    else
            if [ -e "/etc/rc.d/ntpd" ]; then
                    case "$2" in
                            up)
                                    /etc/rc.d/ntpd start
                            ;;
                            vpn-up)
                                    /etc/rc.d/ntpd start
                            ;;
                            down)
                                    /etc/rc.d/ntpd stop
                            ;;
                            vpn-down)
                                    /etc/rc.d/ntpd stop
                            ;;
                    esac
            fi
     
    fi