From 06c00b727b592769fdeb5a33cb0084cb2bfd2639 Mon Sep 17 00:00:00 2001 From: billz Date: Fri, 15 Nov 2019 09:01:57 +0000 Subject: [PATCH] Initial commit --- installers/configauth.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 installers/configauth.sh diff --git a/installers/configauth.sh b/installers/configauth.sh new file mode 100644 index 00000000..81a3ba0d --- /dev/null +++ b/installers/configauth.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Updates openvpn client.conf with auth credentials + +echo "Enabling auth-user-pass in OpenVPN client.conf..." +line='auth-user-pass' +file='/tmp/ovpnclient.ovpn' + +if grep -q "$line" $file; then + echo "Updating line: $line" + sudo sed -i "s/$line/$line login.conf/g" $file +else + echo "Adding line: $line" + sudo sed -i "$ a $line login.conf" $file +fi +