summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmchooser/files/run-virt.sh
diff options
context:
space:
mode:
authorDirk von Suchodoletz2009-02-18 01:35:17 +0100
committerDirk von Suchodoletz2009-02-18 01:35:17 +0100
commit90e3a896cfe3ab9c5862f724191cba330b732a40 (patch)
treee2e64d944af27b7ddbdfeb639293a7fd150360a4 /os-plugins/plugins/vmchooser/files/run-virt.sh
parentSmall fixes ... (perl stuff failed) (diff)
downloadcore-90e3a896cfe3ab9c5862f724191cba330b732a40.tar.gz
core-90e3a896cfe3ab9c5862f724191cba330b732a40.tar.xz
core-90e3a896cfe3ab9c5862f724191cba330b732a40.zip
Some first script cleanups ... more to follow.
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2595 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, 23 insertions, 3 deletions
diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh
index ac17d391..af92426d 100644
--- a/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -18,11 +18,14 @@
# fied virtualization tool.
# -----------------------------------------------------------------------------
+# check for running in graphical environment otherwise no much use here
+[ -z "$DISPLAY" ] && echo -e "\n\tStart only within a desktop!\n" && exit 1
+
# The PATH...
export PATH="${PATH}:/var/X11R6/bin:/usr/X11R6/bin"
# Read needed variables from XML file
-################################################################################
+###############################################################################
xml=$1
# file name of the image
@@ -50,13 +53,19 @@ serial=$(grep -i "<serial port=\"" ${xml} | awk -F "\"" '{ print $2 }')
# declaration of default variables
-################################################################################
+###############################################################################
# standard variables
# get total amount of memory installed in your machine
totalmem=$(expr $(grep -i "memtotal" /proc/meminfo | awk '{print $2}') / 1024)
+# 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
+# system
+mac=$(/sbin/ifconfig eth0 | grep eth0 | sed -e "s/ //g" \
+ | awk -F ":" '{print $(NF-1)":"$NF}')
+
# virtual fd/cd/dvd and drive devices, floppy b: for configuration
#floppya is always false, if we have a floppy device or not isn't
@@ -85,7 +94,7 @@ diskfile="${vmdir}/${imagename}"
# functions used throughout the script
-################################################################################
+###############################################################################
# check for files
filecheck ()
@@ -145,6 +154,17 @@ filecheck ()
# gured
################################################################################
+# logo for console
+cat <<EOL
+
+ .----.--.--.-----.--.--.--------.--.--.--.---.-.----.-----.
+ | _| | | | | | | | | | _ | _| -__|
+ |__| |_____|__|__|\___/|__|__|__|________|___._|__| |_____|
+ Script for preparing virtual machine environment ...
+
+EOL
+
+
# adjust volume
writelog "Unmuting sound...\c "
amixer -q sset Master 28 unmute 2>/dev/null