diff --git a/update/init.sh b/update/init.sh index 29f5689..a99de64 100644 --- a/update/init.sh +++ b/update/init.sh @@ -1,15 +1,17 @@ #!/bin/bash +#============================================================================== /usr/bin/qbittorrent-nox --webui-port=10005 -d /usr/bin/bash /opt/scripts/update/calibre.sh mv /opt/wd/99-Temp/shutdown /opt/wd/99-Temp/shutdown.old - +#============================================================================== +/usr/bin/bash /opt/scripts/update/macvlan.sh +#============================================================================== ip link set enp1s0 promisc on ip link set enp2s0 promisc on ip link set wlx90de80ca01ec promisc on - +#============================================================================== /usr/bin/bash /opt/scripts/update/jekyll_update.sh - # /usr/bin/mount -t ext4 -w UUID="b7c2c4b8-bfde-479b-80bb-655432a433b8" /opt/wd diff --git a/update/macvlan.sh b/update/macvlan.sh new file mode 100644 index 0000000..ef49b55 --- /dev/null +++ b/update/macvlan.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +gateway=`ip route | head -n 1 | grep -Eow '([0-9]{1,3}.){3}[0-9]{1,3}'` +[[ $gateway == '' ]] && exit 9 + +num1=`echo $gateway | awk -F '.' '{print $1}'` +num2=`echo $gateway | awk -F '.' '{print $2}'` +num3=`echo $gateway | awk -F '.' '{print $3}'` + +for num4 in `seq 200 254`; do + IP=$num1'.'$num2'.'$num3'.'$num4 + ping -c 2 $IP + [[ $? -ne 0 ]] && break +done + + ip link add main2wrt link enp1s0 type macvlan mode bridge +ip addr add $IP dev main2wrt +ip link set main2wrt up +ip route add $IP dev main2wrt + +ip link set main2wrt promisc on +