Browse Source

Don't restart openvpn if it's not installed

Bob Mottram 7 years ago
parent
commit
7e25a5303e
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/freedombone-app-vpn

+ 6
- 0
src/freedombone-app-vpn View File

59
                VPN_TLS_PORT)
59
                VPN_TLS_PORT)
60
 
60
 
61
 function logging_on_vpn {
61
 function logging_on_vpn {
62
+    if [ ! -f /etc/openvpn/server.conf ]; then
63
+        return
64
+    fi
62
     sed -i 's|status .*|status /var/log/openvpn.log|g' /etc/openvpn/server.conf
65
     sed -i 's|status .*|status /var/log/openvpn.log|g' /etc/openvpn/server.conf
63
     systemctl restart openvpn
66
     systemctl restart openvpn
64
 }
67
 }
65
 
68
 
66
 function logging_off_vpn {
69
 function logging_off_vpn {
70
+    if [ ! -f /etc/openvpn/server.conf ]; then
71
+        return
72
+    fi
67
     sed -i 's|status .*|status /dev/null|g' /etc/openvpn/server.conf
73
     sed -i 's|status .*|status /dev/null|g' /etc/openvpn/server.conf
68
     systemctl restart openvpn
74
     systemctl restart openvpn
69
 }
75
 }