change default options to a better one.

This commit is contained in:
primardj 2024-02-21 20:43:31 +00:00
parent b7b534f0bb
commit bd5eb053a6
3 changed files with 32 additions and 12 deletions

View file

@ -1,16 +1,33 @@
#!/bin/sh #!/bin/sh
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
echo "clean firewall" echo "clean firewall"
echo "0" | tee /proc/sys/net/ipv4/ip_forward echo "0" | $rooter tee /proc/sys/net/ipv4/ip_forward
sv stop nftables $rooter sv stop nftables
sv start nftables $rooter sv start nftables
echo "clean veth0 and br0" echo "clean veth0 and br0"
ip link del veth0 $rooter ip link del veth0
ip link del br0 $rooter ip link del br0
ip link del dummy0 $rooter ip link del dummy0
echo "clean the rest of the bridges." echo "clean the rest of the bridges."
ip link del br1 $rooter ip link del br1
ip link del br2 $rooter ip link del br2

View file

@ -1,12 +1,13 @@
#!/bin/sh #!/bin/sh
if which doas &> /dev/null if which doas 2> /dev/null
then then
rooter=$(which doas) rooter=$(which doas)
elif which sudo &> /dev/null elif which sudo 2> /dev/null
then then
rooter=$(which sudo) rooter=$(which sudo)
sudo echo "Exec of the script" || exit 1
elif [ "$(id -u)" == "0" ] elif [ "$(id -u)" == "0" ]
then then
rooter="" rooter=""
@ -23,7 +24,7 @@ echo "e"
$rooter nft "table inet my_nat { $rooter nft "table inet my_nat {
chain postrouting { chain postrouting {
type nat hook postrouting priority srcnat; policy accept; type nat hook postrouting priority srcnat; policy accept;
oifname "wlan0" masquerade oifname \"wlan0\" masquerade
} }
}" }"

View file

@ -49,12 +49,14 @@ then
echo "$MAIN_LOCATION created to contain all virtual machines." echo "$MAIN_LOCATION created to contain all virtual machines."
fi fi
OPTION="-display gtk \ OPTION="-display gtk,gl=on,show-cursor=on,show-menubar=off \
-device virtio-gpu-gl \
-usbdevice tablet \ -usbdevice tablet \
-daemonize" -daemonize"
# other options choices # other options choices
# #
#-display gtk,show-menubar=off,gl=on,show-cursor=on,zoom-to-fit=on \
#-display sdl #-display sdl
#-vga qxl #-vga qxl
#-usbdevice tablet \ #-usbdevice tablet \