From be02488fcd6d95cb159ed950f09c6e34a09f2e8e Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sun, 13 Mar 2022 18:15:52 -0500 Subject: [PATCH] Improve VPN setup - Remove add/delete user helper scripts during VPN uninstall. --- extras/vpnuninstall.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/extras/vpnuninstall.sh b/extras/vpnuninstall.sh index ef860da..f24282c 100755 --- a/extras/vpnuninstall.sh +++ b/extras/vpnuninstall.sh @@ -168,12 +168,13 @@ remove_xl2tpd() { fi } -remove_ikev2_script() { - bigecho "Removing IKEv2 script..." - if [ "$(readlink -f /usr/bin/ikev2.sh 2>/dev/null)" = "/opt/src/ikev2.sh" ]; then - /bin/rm -f /usr/bin/ikev2.sh - fi - /bin/rm -f /opt/src/ikev2.sh +remove_helper_scripts() { + bigecho "Removing helper scripts..." + for sc in ikev2.sh addvpnuser.sh delvpnuser.sh; do + if [ "$(readlink -f "/usr/bin/$sc" 2>/dev/null)" = "/opt/src/$sc" ]; then + /bin/rm -f "/usr/bin/$sc" "/opt/src/$sc" + fi + done } update_sysctl() { @@ -302,7 +303,7 @@ remove_vpn() { stop_services remove_ipsec remove_xl2tpd - remove_ikev2_script + remove_helper_scripts update_sysctl update_rclocal update_iptables_rules