summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-03 15:09:48 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-22 21:31:53 +0000
commitd5f6294f409ee47f7202f518a7853f18eb319348 (patch)
tree72727b4bbb17080e57f84398a645d012bed6762c
parentFixing spelling typo in 'bandwidth'. (diff)
downloadcompute-tools-d5f6294f409ee47f7202f518a7853f18eb319348.tar.xz
compute-tools-d5f6294f409ee47f7202f518a7853f18eb319348.zip
Adding interface max length check in container start command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlib/container/start10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/container/start b/lib/container/start
index 102bc71..6d2c7a9 100755
--- a/lib/container/start
+++ b/lib/container/start
@@ -308,6 +308,11 @@ then
NETWORK_VETH_EXTRA="${NETWORK_VETH_EXTRA} --network-veth-extra=${VETH}"
INTERFACE="$(echo ${VETH} | awk -F: '{ print $1 }')"
+ if [ "$(echo ${INTERFACE} | wc -c)" -gt 15 ]
+ 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
@@ -331,6 +336,11 @@ EOF
INTERFACE="$(echo ${BRIDGE_DEFINITION} | awk -F: '{ print $1 }')"
BRIDGE="$(echo ${BRIDGE_DEFINITION} | awk -F: '{ print $2 }')"
+ if [ "$(echo ${INTERFACE} | wc -c)" -gt 15 ]
+ then
+ echo "'${INTERFACE}': name exceeds maximum of 15 characters, network might be not working."
+ fi
+
if [ -n "${BRIDGE}" ] && [ -n "${INTERFACE}" ]
then