diff options
Diffstat (limited to '')
-rwxr-xr-x | lib/container/start | 15 | ||||
-rwxr-xr-x | lib/container/stop | 6 |
2 files changed, 7 insertions, 14 deletions
diff --git a/lib/container/start b/lib/container/start index 13621ff..566b4b0 100755 --- a/lib/container/start +++ b/lib/container/start @@ -295,15 +295,16 @@ then MACHINE="--machine=${NAME}" - NETWORK_VETH_EXTRA_CONF="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" NETWORK_VETH_EXTRA="" - case "${NETWORK_VETH_EXTRA_CONF}" in + VETHS="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" + + case "${VETHS}" in "") ;; *) - for VETH in ${NETWORK_VETH_EXTRA_CONF} + for VETH in ${VETHS} do NETWORK_VETH_EXTRA="${NETWORK_VETH_EXTRA} --network-veth-extra=${VETH}" INTERFACE="$(echo ${VETH} | awk -F: '{ print $1 }')" @@ -312,14 +313,6 @@ then then echo "'${INTERFACE}': name exceeds maximum of 15 characters, network might be not working." fi - -cat > "/etc/network/interfaces.d/${INTERFACE}" << EOF -allow-hotplug ${INTERFACE} -iface ${INTERFACE} inet manual - pre-up ip link set ${INTERFACE} up - post-down ip link set ${INTERFACE} down -EOF - done ;; esac diff --git a/lib/container/stop b/lib/container/stop index 12cf7fa..6b1c986 100755 --- a/lib/container/stop +++ b/lib/container/stop @@ -176,14 +176,14 @@ case "${CLEAN}" in fi # Removing network configuration - NETWORK_VETH_EXTRA_CONF="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" + VETHS="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)" - case "${NETWORK_VETH_EXTRA_CONF}" in + case "${VETHS}" in "") ;; *) - for VETH in ${NETWORK_VETH_EXTRA_CONF} + for VETH in ${VETHS} do INTERFACE="$(echo ${VETH} | awk -F: '{ print $1 }')" FILE="/etc/network/interfaces.d/${INTERFACE}" |