summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/scripts
diff options
context:
space:
mode:
authorJonathan Bauer2017-08-10 15:50:35 +0200
committerJonathan Bauer2017-08-10 15:50:35 +0200
commitc05cb427de3cf52d63fc53b140f0abf010d70a04 (patch)
treecd6c08143ffb638e6244523c1fca083f42c8544f /core/modules/run-virt/data/opt/openslx/scripts
parent[rfs-s32] sequential download of slx addons (diff)
downloadmltk-c05cb427de3cf52d63fc53b140f0abf010d70a04.tar.gz
mltk-c05cb427de3cf52d63fc53b140f0abf010d70a04.tar.xz
mltk-c05cb427de3cf52d63fc53b140f0abf010d70a04.zip
[run-virt] fix bad code
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/scripts')
-rwxr-xr-xcore/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env b/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env
index ddffa4e9..32cf492f 100755
--- a/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env
+++ b/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env
@@ -109,11 +109,12 @@ echo "HOSTMACADDR='$HOSTMACADDR'" >> "${VMCHOOSER_VIRT_CONF}"
# If not, or the host's prefix is the last one in the list, use the first one.
# This lays the groundwork to avoid mac addresses collisions in nested operations.
MACADDRPREFIX=
-for i in {0..9}; do
- if [ "x${HOSTMACADDR#00:FF:0$i}" != "x${HOSTMACADDR}" ]; then
+for i in $(seq 0 8); do
+ if [ "x${HOSTMACADDR#00:FF:0$i}" == "x${HOSTMACADDR}" ]; then
# current prefix is indeed part of the host's mac address
# use the next prefix if != 9
- [ $i -lt 9 ] && MACADDRPREFIX="00:FF:0$(( i++ ))"
+ MACADDRPREFIX="00:FF:0$(( i + 1 ))"
+ break
fi
done
# if it is still unset, then either the host's prefix did not match any in the list