From fa4aa74d43d5b02116de37a00ccb295758e50756 Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Fri, 26 May 2017 15:16:25 +0200 Subject: [PATCH] add a workaround to bring up lokal host only virtualbox interfaces --- home/fix-vbox-net.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 home/fix-vbox-net.sh 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 -- 2.39.5