From d90675fcdf106f3df6164ffcd688ff2932f74e96 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 21 Apr 2023 07:11:36 +0200 Subject: [PATCH] Shellcheck --- run/network.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/run/network.sh b/run/network.sh index 3cee657..3d59caf 100644 --- a/run/network.sh +++ b/run/network.sh @@ -29,16 +29,16 @@ configureDHCP() { echo "docker variable to your container: --device=/dev/vhost-net" && exit 85 fi - VM_NET_TAP="_VmMacvtap" + VM_NET_TAP="dsm" echo "Info: Retrieving IP via DHCP using MAC ${VM_NET_MAC}..." - ip l add link eth0 name ${VM_NET_TAP} address ${VM_NET_MAC} type macvtap mode bridge || true - ip l set ${VM_NET_TAP} up + ip l add link eth0 name "${VM_NET_TAP}" address "${VM_NET_MAC}" type macvtap mode bridge || true + ip l set "${VM_NET_TAP}" up ip a flush eth0 - ip a flush ${VM_NET_TAP} + ip a flush "${VM_NET_TAP}" - DHCP_IP=$( dhclient -v ${VM_NET_TAP} 2>&1 | grep ^bound | cut -d' ' -f3 ) + DHCP_IP=$( dhclient -v "${VM_NET_TAP}" 2>&1 | grep ^bound | cut -d' ' -f3 ) if [[ "${DHCP_IP}" == [0-9.]* ]]; then echo "Info: Retrieved IP ${DHCP_IP} via DHCP" @@ -46,12 +46,12 @@ configureDHCP() { echo "ERROR: Cannot retrieve IP from DHCP using MAC ${VM_NET_MAC}" && exit 16 fi - ip a flush ${VM_NET_TAP} + ip a flush "${VM_NET_TAP}" TAP_PATH="/dev/tap$(>$TAP_PATH; then + if ! exec 30>>"$TAP_PATH"; then echo -n "ERROR: Please add the following docker variables to your container: " echo "--device=/dev/vhost-net --device-cgroup-rule='c ${MAJOR}:* rwm'" && exit 21 fi