diff --git a/ethernet_restreint/clean_no_restrent.sh b/ethernet_restreint/clean_no_restrent.sh index 2e4401c..1e404ef 100755 --- a/ethernet_restreint/clean_no_restrent.sh +++ b/ethernet_restreint/clean_no_restrent.sh @@ -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 diff --git a/ethernet_restreint/no_restreint.sh b/ethernet_restreint/no_restreint.sh index bfac48c..9e358fd 100755 --- a/ethernet_restreint/no_restreint.sh +++ b/ethernet_restreint/no_restreint.sh @@ -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 } }" diff --git a/vm-start.sh b/vm-start.sh index d9384ae..6551922 100755 --- a/vm-start.sh +++ b/vm-start.sh @@ -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 \