change default options to a better one.
This commit is contained in:
parent
b7b534f0bb
commit
bd5eb053a6
3 changed files with 32 additions and 12 deletions
|
@ -1,16 +1,33 @@
|
|||
#!/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 "0" | tee /proc/sys/net/ipv4/ip_forward
|
||||
sv stop nftables
|
||||
sv start nftables
|
||||
echo "0" | $rooter tee /proc/sys/net/ipv4/ip_forward
|
||||
$rooter sv stop nftables
|
||||
$rooter sv start nftables
|
||||
|
||||
echo "clean veth0 and br0"
|
||||
ip link del veth0
|
||||
ip link del br0
|
||||
ip link del dummy0
|
||||
$rooter ip link del veth0
|
||||
$rooter ip link del br0
|
||||
$rooter ip link del dummy0
|
||||
|
||||
echo "clean the rest of the bridges."
|
||||
ip link del br1
|
||||
ip link del br2
|
||||
$rooter ip link del br1
|
||||
$rooter ip link del br2
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
|
||||
if which doas &> /dev/null
|
||||
if which doas 2> /dev/null
|
||||
then
|
||||
rooter=$(which doas)
|
||||
elif which sudo &> /dev/null
|
||||
elif which sudo 2> /dev/null
|
||||
then
|
||||
rooter=$(which sudo)
|
||||
sudo echo "Exec of the script" || exit 1
|
||||
elif [ "$(id -u)" == "0" ]
|
||||
then
|
||||
rooter=""
|
||||
|
@ -23,7 +24,7 @@ echo "e"
|
|||
$rooter nft "table inet my_nat {
|
||||
chain postrouting {
|
||||
type nat hook postrouting priority srcnat; policy accept;
|
||||
oifname "wlan0" masquerade
|
||||
oifname \"wlan0\" masquerade
|
||||
}
|
||||
}"
|
||||
|
||||
|
|
|
@ -49,12 +49,14 @@ then
|
|||
echo "$MAIN_LOCATION created to contain all virtual machines."
|
||||
fi
|
||||
|
||||
OPTION="-display gtk \
|
||||
OPTION="-display gtk,gl=on,show-cursor=on,show-menubar=off \
|
||||
-device virtio-gpu-gl \
|
||||
-usbdevice tablet \
|
||||
-daemonize"
|
||||
|
||||
# other options choices
|
||||
#
|
||||
#-display gtk,show-menubar=off,gl=on,show-cursor=on,zoom-to-fit=on \
|
||||
#-display sdl
|
||||
#-vga qxl
|
||||
#-usbdevice tablet \
|
||||
|
|
Loading…
Reference in a new issue