mirror of
https://github.com/pivpn/pivpn.git
synced 2025-04-24 00:00:11 +00:00
Support reverting UFW changes on uninstall
This commit is contained in:
parent
a432e187b9
commit
3916acf665
2 changed files with 13 additions and 2 deletions
|
@ -18,6 +18,7 @@ fi
|
|||
|
||||
INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER)
|
||||
PLAT=$(cat /etc/pivpn/DET_PLATFORM)
|
||||
NO_UFW=$(cat /etc/pivpn/NO_UFW)
|
||||
|
||||
# Find the rows and columns
|
||||
rows=$(tput lines)
|
||||
|
@ -99,6 +100,12 @@ echo ":::"
|
|||
sed -i '/net.ipv4.ip_forward=1/c\#net.ipv4.ip_forward=1' /etc/sysctl.conf
|
||||
sysctl -p
|
||||
|
||||
if [[ $NO_UFW -eq 0 ]]; then
|
||||
$SUDO sed -i "s/\(DEFAULT_FORWARD_POLICY=\).*/\1\"DROP\"/" /etc/default/ufw
|
||||
$SUDO sed -i '/START OPENVPN RULES/,/END OPENVPN RULES/ d' /etc/ufw/before.rules
|
||||
$SUDO ufw reload
|
||||
fi
|
||||
|
||||
echo ":::"
|
||||
printf "::: Finished removing PiVPN from your system.\n"
|
||||
printf "::: Reinstall by simpling running\n:::\n:::\tcurl -L https://install.pivpn.io | bash\n:::\n::: at any time!\n:::\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue