From dc9924f147105020725f48167358a21ff03856e5 Mon Sep 17 00:00:00 2001 From: Kaladin Light <0.kaladin@gmail.com> Date: Fri, 27 Jan 2017 17:46:34 -0500 Subject: [PATCH] Have debug work without being root --- auto_install/install.sh | 2 ++ pivpn | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 989c7c2..0f3d12d 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -244,6 +244,8 @@ chooseInterface() { if [[ $(echo "${availableInterfaces}" | wc -l) -eq 1 ]]; then pivpnInterface="${availableInterfaces}" + echo "${pivpnInterface}" > /tmp/pivpnINT + $SUDO cp /tmp/pivpnINT /etc/pivpn/pivpnINTERFACE return fi diff --git a/pivpn b/pivpn index 684567a..fca88c2 100644 --- a/pivpn +++ b/pivpn @@ -29,14 +29,14 @@ function listOVPNFunc { function debugFunc { noUFW=$(cat /etc/pivpn/NO_UFW) echo "::: Generating Debug Output" - $SUDO . /opt/pivpn/pivpnDebug.sh | tee /tmp/debug.txt + $SUDO /opt/pivpn/pivpnDebug.sh | tee /tmp/debug.txt echo "::: " echo "::: Debug output completed above." echo "::: Copy saved to /tmp/debug.txt" echo "::: " if [[ ${noUFW} -eq 1 ]]; then - IPTABLES_FIX=`iptables -t nat -L -n -v | grep -c 'MASQUERADE.*10.8.0.0\/24'` - iptables -t nat -L -n -v | grep -q 'MASQUERADE.*10.8.0.0\/24' + IPTABLES_FIX=`$SUDO iptables -t nat -L -n -v | grep -c 'MASQUERADE.*10.8.0.0\/24'` + $SUDO iptables -t nat -L -n -v | grep -q 'MASQUERADE.*10.8.0.0\/24' if [ $? -ne 0 ]; then IPTABLES_FIX=2 fi