From cd92bdae4655399fe04c9bc1e06817ca54f1a63c Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 17 Nov 2019 19:08:39 +0000 Subject: [PATCH] Update iptables msgs --- installers/configauth.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/installers/configauth.sh b/installers/configauth.sh index 65224e4d..5fc6965a 100755 --- a/installers/configauth.sh +++ b/installers/configauth.sh @@ -11,20 +11,20 @@ auth=$2 interface=$3 if [ "$auth" = 1 ]; then - echo "Enabling auth-user-pass in OpenVPN client.conf" - line='auth-user-pass' - if grep -q "$line" $file; then - echo "Updating $line" - sudo sed -i "s/$line/$line login.conf/g" $file - else - echo "Adding $line" - sudo sed -i "$ a $line login.conf" $file - fi + echo "Enabling auth-user-pass in OpenVPN client.conf" + line='auth-user-pass' + if grep -q "$line" $file; then + echo "Updating $line" + sudo sed -i "s/$line/$line login.conf/g" $file + else + echo "Adding $line" + sudo sed -i "$ a $line login.conf" $file + fi fi # Generate iptables entries to place into rc.local file. # #RASPAP is for uninstall script -echo "Adding iptables rules for $interface" +echo "Checking iptables rules for $interface" lines=( "iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE #RASPAP" @@ -33,11 +33,11 @@ lines=( ) for line in "${lines[@]}"; do - if grep "$line" /etc/rc.local > /dev/null; then - # iptables rule exists + if grep "$line" /etc/rc.local > /dev/null; then else - sudo sed -i "s/^exit 0$/$line\nexit 0/" /etc/rc.local - fi + sudo sed -i "s/^exit 0$/$line\nexit 0/" /etc/rc.local + echo "Adding rule: $line" + fi done # Force a reload of new settings in /etc/rc.local