summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmchooser/files/run-virt.sh
diff options
context:
space:
mode:
authorDirk von Suchodoletz2009-02-20 19:16:09 +0100
committerDirk von Suchodoletz2009-02-20 19:16:09 +0100
commit60013293f2a329c6b53cfb1fbe3a0aea704c4b8c (patch)
tree6797bff0d184d19ddfb6963e4687abb628583a12 /os-plugins/plugins/vmchooser/files/run-virt.sh
parentFix for gdm in new SuSE11.1 (see #380). (diff)
downloadcore-60013293f2a329c6b53cfb1fbe3a0aea704c4b8c.tar.gz
core-60013293f2a329c6b53cfb1fbe3a0aea704c4b8c.tar.xz
core-60013293f2a329c6b53cfb1fbe3a0aea704c4b8c.zip
Small fixes to run-virt.sh script ...
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2624 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/vmchooser/files/run-virt.sh')
-rw-r--r--os-plugins/plugins/vmchooser/files/run-virt.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh
index 205179e7..c195e7c1 100644
--- a/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -22,7 +22,8 @@
###############################################################################
# check for running in graphical environment otherwise no much use here
-[ -z "$DISPLAY" ] && echo -e "\n\tStart only within a desktop!\n" && exit 1
+[ -z "$DISPLAY" ] && echo -e "\n\tStart only within a graphical desktop!\n" \
+ && exit 1
# test if the xml path/file is valid (gotten via commandline first parameter)
xml=$1
@@ -37,7 +38,7 @@ imagepath=${xml%/*}
# file name of the image
imagename=$(grep -i "<image_name param=\"" ${xml} | awk -F "\"" '{ print $2 }')
diskfile=$imagepath/$imagename
-[ -e $diskfile ] && { echo -e "\n\tImage file $diskfile not found!"; exit 1; }
+[ -e $diskfile ] || { echo -e "\n\tImage file $diskfile not found!"; exit 1; }
# short description of the image (as present in the vmchooser menu line)
short_description=$(grep "short_description param=\"" ${xml} | \
@@ -154,8 +155,13 @@ cp ${xml} /var/lib/virt/vmchooser/fd-loop/config.xml
filecheck
# get all virtual machine specific stuff from the respective include file
-. /etc/opt/openslx/run-${virt_mach}.include
-${VIRTCMD} ${VIRTCMDOPTS}
+if [ -e /etc/opt/openslx/run-${virt_mach}.include ] ; then
+ . /etc/opt/openslx/run-${virt_mach}.include
+ ${VIRTCMD} ${VIRTCMDOPTS}
+ writelog "Bye.\n"
+ exit 0
+else
+ writelog "Failed because of missing ${virt_mach} plugin."
+ exit 1
+fi
-writelog "Bye.\n"
-exit 0