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-03 15:09:48 +0000
commitf06f9d721b29466d2c0637016608d4764b421e42 (patch)
tree6936942d46de54af0faed182fa8cf0b079769355
parentCorrecting typo in comment in curl container create script. (diff)
downloadcompute-tools-f06f9d721b29466d2c0637016608d4764b421e42.tar.xz
compute-tools-f06f9d721b29466d2c0637016608d4764b421e42.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 88f2ea6..99639f6 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