diff options
Diffstat (limited to 'os-plugins/plugins/vmchooser/files/run-virt.sh')
-rw-r--r-- | os-plugins/plugins/vmchooser/files/run-virt.sh | 26 |
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 |