summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
diff options
context:
space:
mode:
authorSimon Rettberg2014-05-04 13:38:28 +0200
committerSimon Rettberg2014-05-04 13:38:28 +0200
commite20da74f86f668bd5c247545d2a10d7dd17c3ccb (patch)
tree27a2859759031b1e3c35e17e5277c8fa50d26a6d /remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
parent[vmchooser-openslx] Remove pointless config module... (diff)
downloadtm-scripts-e20da74f86f668bd5c247545d2a10d7dd17c3ccb.tar.gz
tm-scripts-e20da74f86f668bd5c247545d2a10d7dd17c3ccb.tar.xz
tm-scripts-e20da74f86f668bd5c247545d2a10d7dd17c3ccb.zip
[vmchooser2] !
Diffstat (limited to 'remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser')
-rwxr-xr-xremote/modules/vmchooser2/data/opt/openslx/bin/vmchooser23
1 files changed, 23 insertions, 0 deletions
diff --git a/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser b/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
new file mode 100755
index 00000000..7f53d202
--- /dev/null
+++ b/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
@@ -0,0 +1,23 @@
+#!/bin/ash
+
+# This script launches the real vmchooser (vmchooser.real)
+# It's here to pass the XML URL, coming from
+# /opt/openslx/config, as well as the pool filter (if any)
+
+. /opt/openslx/config
+
+if [ -n "$SLX_VMCHOOSER_BASE_URL" ]; then
+ URL="$SLX_VMCHOOSER_BASE_URL"
+elif [ -n "$SLX_PXE_SERVER_IP" ]; then
+ URL="http://$SLX_PXE_SERVER_IP/vmchooser/"
+else
+ slxlog "virt-vmchooser" "vmchooser: Could not determine URL to fetch VM list from! (need SLX_VMCHOOSER_BASE_URL)"
+ # TODO: Tell user
+fi
+
+if [ -n "$SLX_VM_POOL_FILTER" ]; then
+ vmchooser.real --url "$URL" --pool "$SLX_VM_POOL_FILTER"
+else
+ vmchooser.real --url "$URL"
+fi
+