1
0
mirror of synced 2025-01-31 12:32:20 +03:00

Improve VPN setup

- Remove add/delete user helper scripts during VPN uninstall.
This commit is contained in:
hwdsl2 2022-03-13 18:15:52 -05:00
parent e8c738d6af
commit be02488fcd

View File

@ -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