From 2b91732ec30ee20c6533d0d9719ce0dd83fe3306 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Thu, 26 Feb 2009 23:12:52 +0000 Subject: Cleanups, mini-fix and comments ... git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2651 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/vmchooser/files/run-virt.sh | 83 +++++++++++++------------- 1 file changed, 40 insertions(+), 43 deletions(-) (limited to 'os-plugins/plugins/vmchooser/files/run-virt.sh') diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh index 8ba8ea75..005bf8f8 100644 --- a/os-plugins/plugins/vmchooser/files/run-virt.sh +++ b/os-plugins/plugins/vmchooser/files/run-virt.sh @@ -32,57 +32,58 @@ xml=$1 # Read needed variables from XML file ############################################################################### -# file name of the image +# File name of the image imagename=$(grep -io "/dev/null| grep -ve "^$") xres=$(echo "${hostres}" | awk '{print $3}') yres=$(echo "${hostres}" | awk '{print $7}') -# set hostname: using original hostname and adding string "-vm" +# Set hostname: using original hostname and adding string "-vm" hostname="VM-${HOST}" -# functions used throughout the script +# Functions used throughout the script ############################################################################### -# check for files +# Check for important files used filecheck () { filecheck=$(LANG=us ls -lh ${diskfile} 2>&1) writelog "Filecheck:\n${filecheck}\n" - #TODO: don't understand the sence in it noimage=$(echo ${filecheck} | grep -i "no such file or directory" | wc -l) rightsfile=${diskfile} # check if link - # TODO: mistake with 2nd rightsfile if its in another directory? if [ -L "${diskfile}" ]; then # take link target rightsfile=$(ls -lh ${diskfile} 2>&1 | awk -F "-> *" '{print $2}') @@ -144,7 +141,7 @@ filecheck () exit 1 fi - # readable? + # readable by calling user if ! [ -r "${diskfile}" >/dev/null 2>&1 \ -o -r "${diskfile}" >/dev/null 2>&1 ]; then writelog "Vmware Image Problem:\c " @@ -168,35 +165,35 @@ filecheck () fi } -# function to write to stdout and logfile +# Function to write to stdout and logfile writelog () { - # write to stdout + # Write to stdout echo -e "$1" - # log into file + # Log into file echo -e "$1" >>run-virt.log } -# setup the rest of the environment and run the virtualization tool just confi- +# Setup the rest of the environment and run the virtualization tool just confi- # gured ################################################################################ # The PATH... export PATH="${PATH}:/var/X11R6/bin:/usr/X11R6/bin" -# logo for console +# Logo for console cat </dev/null amixer -q sset PCM 28 unmute 2>/dev/null @@ -204,14 +201,14 @@ amixer -q sset Headphone 28 unmute 2>/dev/null amixer -q sset Front 0 mute 2>/dev/null writelog "finished\n" -# copy guest configuration config.xml to be accessed via virtual floppy +# Copy guest configuration (with added information) config.xml to be accessed +# via virtual floppy cp ${xml} /var/lib/virt/vmchooser/fd-loop/config.xml -# check if virtual machine container file exists +# Check if virtual machine container file exists filecheck - -# get all virtual machine specific stuff from the respective include file +# Get all virtual machine specific stuff from the respective include file if [ -e /etc/opt/openslx/run-${virt_mach}.include ] ; then . /etc/opt/openslx/run-${virt_mach}.include ${VIRTCMD} ${VIRTCMDOPTS} -- cgit v1.2.3-55-g7522