summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmchooser/files/run-virt.sh
diff options
context:
space:
mode:
authorMichael Janczyk2009-11-04 14:17:42 +0100
committerMichael Janczyk2009-11-04 14:17:42 +0100
commitcfc6a5a0bc1cebe438fb9a48ac09e64cfc93ef34 (patch)
tree9e8bc60784b214ab4ded9c57cda7d2a193729768 /os-plugins/plugins/vmchooser/files/run-virt.sh
parentwrong script changed :( (diff)
downloadcore-cfc6a5a0bc1cebe438fb9a48ac09e64cfc93ef34.tar.gz
core-cfc6a5a0bc1cebe438fb9a48ac09e64cfc93ef34.tar.xz
core-cfc6a5a0bc1cebe438fb9a48ac09e64cfc93ef34.zip
vmchooser /w new path /etc/opt/openslx/plugins/vmchooser
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@3194 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.sh26
1 files changed, 15 insertions, 11 deletions
diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh
index 4d210b88..d7a587f2 100644
--- a/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -25,7 +25,7 @@ PLUGINCONFDIR=${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser
. ${PLUGINCONFDIR}/run-virt.include
# Sanity checks
-###############################################################################
+################################################################################
# Theck for running in graphical environment otherwise no much use here
[ -z "$DISPLAY" ] && echo -e "\n\tStart only within a graphical desktop!\n" \
@@ -36,10 +36,11 @@ xml=$1
[ -e "${xml}" ] || { echo -e "\n\tNo XML file given!\n"; exit 1; }
# Read needed variables from XML file
-###############################################################################
+################################################################################
# File name of the image
-imagename=$(grep -io "<image_name param=.*\"" ${xml} | awk -F "\"" '{ print $2 }')
+imagename=$(grep -io "<image_name param=.*\"" ${xml} | \
+ awk -F "\"" '{ print $2 }')
case ${xml} in
/tmp/*)
@@ -47,7 +48,8 @@ case ${xml} in
diskfile=$imagename
;;
*)
- # Path to the image (readlink produces the absolute path if called relatively)
+ # Path to the image
+ # (readlink produces the absolute path if called relatively)
[ -z $imgpath ] && \
{ imgpath=$(readlink -f $xml); imgpath=${imgpath%/*.xml}; }
# Diskfile is file including absolute path to it
@@ -88,21 +90,23 @@ if [ -z ${virt_mach} ] ; then
fi
# Definition of the client system
-vmostype=$(grep -io "<os param=.*\"" ${xml} | awk -F "\"" '{ print $2 }')
+vmostype=$(grep -io '<os param=.*"' ${xml} | awk -F '"' '{ print $2 }')
# Definition of the networking the client system is connected to
-network_kind=$(grep -io "<network param=.*\"" ${xml} | awk -F "\"" '{ print $2 }')
-network_card=$(grep -io "<netcard param=.*\"" ${xml} | awk -F "\"" '{ print $2 }')
+network_kind=$(grep -io '<network param=.*"' ${xml} | awk -F '"' '{ print $2 }')
+network_card=$(grep -io '<netcard param=.*"' ${xml} | awk -F '"' '{ print $2 }')
# Serial/parallel ports defined (e.g. "ttyS0" or "autodetect")
-serial=$(grep -io "<serialport param=.*\"" ${xml} | awk -F "\"" '{ print $2 }')
-parallel=$(grep -io "<parport param=.*\"" ${xml} | awk -F "\"" '{ print $2 }')
+serial=$(grep -io '<serialport param=.*"' ${xml} | awk -F '"' '{ print $2 }')
+parallel=$(grep -io '<parport param=.*"' ${xml} | awk -F '"' '{ print $2 }')
# Declaration of default variables
###############################################################################
# Get total amount of memory installed in your machine
totalmem=$(expr $(grep -i "memtotal" /proc/meminfo | awk '{print $2}') / 1024)
+permem=60
+mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
# Configuring ethernet mac address: first four bytes are fixed (00:50:56:0D)
# the last two bytes are taken from the first local network adaptor of the host
@@ -156,7 +160,7 @@ filecheck ()
# Check if link
if [ -L "${diskfile}" ]; then
# take link target
- rightsfile=$(ls -lh ${diskfile} 2>&1 | awk -F "-> *" '{print $2}')
+ rightsfile=$(ls -lh ${diskfile} 2>&1 | awk -F '-> *' '{print $2}')
rightsfile=${vmdir}/${rightsfile}
filecheck=$(LANG=us ls -lh ${rightsfile} 2>&1)
fi
@@ -227,7 +231,7 @@ amixer -q sset Master 80% unmute 2>/dev/null
amixer -q sset PCM 80% unmute 2>/dev/null
amixer -q sset CD 80% unmute 2>/dev/null
amixer -q sset Headphone 80% unmute 2>/dev/null
-amixer -q sset Front 80% umute 2>/dev/null # In SUSE 11.0 it's Headphone
+amixer -q sset Front 80% umute 2>/dev/null # in SUSE 11.0 it's headphone
amixer -q sset Speaker 0 mute 2>/dev/null # annoying built-in speaker
writelog "finished\n"