From 22666a6f2ffdf20e54128f47a69112d72c74cb01 Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Wed, 27 Apr 2016 00:39:06 +0200 Subject: [PATCH] Up/down scripts are managed by options to openvpn, also no longer need specific device name --- openvpn/adjustConfigs.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/openvpn/adjustConfigs.sh b/openvpn/adjustConfigs.sh index 361f42aec..e4da051c9 100755 --- a/openvpn/adjustConfigs.sh +++ b/openvpn/adjustConfigs.sh @@ -29,8 +29,10 @@ provider=$1 for configFile in $provider/*.ovpn; do - # Set fixed tun device number - sed -i "s/dev tun.*/dev tun0/g" "$configFile" + if [ -h ${configFile} ]; + then + continue # Don't edit symbolic links (default.ovpn) + fi # Absolute reference to ca cert sed -i "s/ca .*\.crt/ca \/etc\/openvpn\/$provider\/ca.crt/g" "$configFile" @@ -41,16 +43,6 @@ for configFile in $provider/*.ovpn; # Set user-pass file location sed -i "s/auth-user-pass.*/auth-user-pass \/config\/openvpn-credentials.txt/g" "$configFile" - # Insert transmission control script triggers - cat <> $configFile - - -# OpenVPN controls startup and shut down of transmission -script-security 2 -up /etc/transmission/start.sh -down /etc/transmission/stop.sh -EOT - done echo "Updated all .ovpn files in folder $provider"