summarylogtreecommitdiffstats
path: root/10-sshd
blob: bc46b1f09bf97122f8978334dc7c59b0068cd128 (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 sshd.service
                ;;
                vpn-up)
                        systemctl start sshd.service
                ;;
                down)
                        systemctl stop sshd.service
                ;;
                vpn-down)
                        systemctl stop sshd.service
                ;;
        esac
else

  if [ -e "/etc/rc.d/sshd" ]; then
          case "$2" in
                  up)
                          /etc/rc.d/sshd start
                  ;;
                  vpn-up)
                          /etc/rc.d/sshd start
                  ;;
                  down)
                          /etc/rc.d/sshd stop
                  ;;
                  vpn-down)
                          /etc/rc.d/sshd stop
                  ;;
          esac
  fi
fi