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,11 +59,17 @@ vpn_variables=(MY_EMAIL_ADDRESS
59 59
                VPN_TLS_PORT)
60 60
 
61 61
 function logging_on_vpn {
62
+    if [ ! -f /etc/openvpn/server.conf ]; then
63
+        return
64
+    fi
62 65
     sed -i 's|status .*|status /var/log/openvpn.log|g' /etc/openvpn/server.conf
63 66
     systemctl restart openvpn
64 67
 }
65 68
 
66 69
 function logging_off_vpn {
70
+    if [ ! -f /etc/openvpn/server.conf ]; then
71
+        return
72
+    fi
67 73
     sed -i 's|status .*|status /dev/null|g' /etc/openvpn/server.conf
68 74
     systemctl restart openvpn
69 75
 }