Improve setup

- When uninstalling the VPN, disable IP forwarding.
This commit is contained in:
hwdsl2 2022-09-09 08:53:55 -05:00
parent b3053b048d
commit 04922c83cc

View File

@ -628,6 +628,11 @@ else
fi
systemctl disable --now wg-quick@wg0.service
rm -f /etc/sysctl.d/99-wireguard-forward.conf /etc/sysctl.d/99-wireguard-optimize.conf
if [ ! -f /usr/sbin/openvpn ] && [ ! -f /usr/sbin/ipsec ] \
&& [ ! -f /usr/local/sbin/ipsec ]; then
echo 0 > /proc/sys/net/ipv4/ip_forward
echo 0 > /proc/sys/net/ipv6/conf/all/forwarding
fi
if [[ "$os" == "ubuntu" ]]; then
# Ubuntu
(