From: Sven Hoexter Date: Fri, 26 May 2017 13:16:25 +0000 (+0200) Subject: add a workaround to bring up lokal host only virtualbox interfaces X-Git-Url: http://git.sven.stormbind.net/?p=sven%2Fscripts.git;a=commitdiff_plain;h=fa4aa74d43d5b02116de37a00ccb295758e50756 add a workaround to bring up lokal host only virtualbox interfaces --- diff --git a/home/fix-vbox-net.sh b/home/fix-vbox-net.sh new file mode 100755 index 0000000..bc58a85 --- /dev/null +++ b/home/fix-vbox-net.sh @@ -0,0 +1,18 @@ +#!/bin/bash +VBoxManage list hostonlyifs | + while IFS= read -r line; do + if [[ ${line} =~ ^Name ]]; then + lastIf=$(echo ${line} | cut -d' ' -f 2) + fi + + if [[ ${line} =~ ^IPAddress ]]; then + lastIfIP=$(echo ${line} | cut -d' ' -f 2) + fi + + if [[ ${line} =~ ^NetworkMask ]]; then + lastIfNetM=$(echo ${line} | cut -d' ' -f 2) + sudo ip link set up dev ${lastIf} + sudo ip a a ${lastIfIP}/${lastIfNetM} dev ${lastIf} + unset -v lastIf lastIfIP lastIfNetM + fi + done