summaryrefslogtreecommitdiffstats
path: root/lib/container/create
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-06-01 13:56:36 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-06-01 13:56:36 +0000
commitac9d7da1d6f69a0a6fbb8e3729a24b9fa775f923 (patch)
tree38a95003274e9ae485abef49d36501d078fe0bf4 /lib/container/create
parentAdding upstream version 20160515. (diff)
downloadopen-infrastructure-compute-tools-ac9d7da1d6f69a0a6fbb8e3729a24b9fa775f923.tar.xz
open-infrastructure-compute-tools-ac9d7da1d6f69a0a6fbb8e3729a24b9fa775f923.zip
Adding upstream version 20160601.upstream/20160601
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lib/container/create')
-rwxr-xr-xlib/container/create31
1 files changed, 27 insertions, 4 deletions
diff --git a/lib/container/create b/lib/container/create
index 0b0aa3a..dea1e76 100755
--- a/lib/container/create
+++ b/lib/container/create
@@ -103,11 +103,34 @@ then
exit 1
fi
-SCRIPT="${SCRIPT:-debian}"
-
-if [ ! -e "/usr/share/container-tools/scripts/${SCRIPT}" ]
+if [ -z "${SCRIPT}" ]
then
- echo "'${SCRIPT}': no such script" >&2
+ if [ -e /usr/share/container-tools/scripts/default ]
+ then
+ TARGET="$(basename $(readlink /usr/share/container-tools/scripts/default))"
+
+ case "${TARGET}" in
+ container-tools_script)
+ TARGET="$(basename $(readlink /etc/alternatives/container-tools_script))"
+ ;;
+ esac
+
+ if [ -e "/usr/share/container-tools/scripts/${TARGET}" ]
+ then
+ SCRIPT="${TARGET}"
+ else
+ echo "default -> '${TARGET}': no such script" >&2
+ exit 1
+ fi
+ else
+ SCRIPT="debian"
+ fi
+else
+ if [ ! -e "/usr/share/container-tools/scripts/${SCRIPT}" ]
+ then
+ echo "'${SCRIPT}': no such script" >&2
+ exit 1
+ fi
fi
CNT_AUTO="${CNT_AUTO:-$(hostname -f)}"