2024-02-19 18:38:08 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-02-21 21:43:31 +01:00
|
|
|
|
|
|
|
if which doas 2> /dev/null
|
|
|
|
then
|
|
|
|
rooter=$(which doas)
|
|
|
|
elif which sudo 2> /dev/null
|
|
|
|
then
|
|
|
|
rooter=$(which sudo)
|
|
|
|
sudo echo "Exec of the script" || exit 1
|
|
|
|
elif [ "$(id -u)" == "0" ]
|
|
|
|
then
|
|
|
|
rooter=""
|
|
|
|
else
|
|
|
|
echo "Error, no enough rights" >&2
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2024-02-19 18:38:08 +01:00
|
|
|
echo "clean firewall"
|
2024-02-21 21:43:31 +01:00
|
|
|
echo "0" | $rooter tee /proc/sys/net/ipv4/ip_forward
|
|
|
|
$rooter sv stop nftables
|
|
|
|
$rooter sv start nftables
|
2024-02-19 18:38:08 +01:00
|
|
|
|
|
|
|
echo "clean veth0 and br0"
|
2024-02-21 21:43:31 +01:00
|
|
|
$rooter ip link del veth0
|
|
|
|
$rooter ip link del br0
|
|
|
|
$rooter ip link del dummy0
|
2024-02-19 18:38:08 +01:00
|
|
|
|
|
|
|
echo "clean the rest of the bridges."
|
2024-02-21 21:43:31 +01:00
|
|
|
$rooter ip link del br1
|
|
|
|
$rooter ip link del br2
|
2024-02-19 18:38:08 +01:00
|
|
|
|