#!/bin/sh #------------------------------------------------------------------------------- # /var/install/bin/xen-domain-config - menu script for editing fli4l config # # Creation: 2005-11-03 fw # Last Update: $Id$ # # $1: Filename of configuration file without extension # # Copyright (c) 2005-2012 the eisfair team, team(at)eisfair(dot)org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #------------------------------------------------------------------------------- . /var/install/include/xenlib #exec 2> /tmp/xen-domain-config-trace$$.log #set -x clrhome check_if_xend_runing $debugLvl while [ 1 ] do clrhome remove $varrun echo mecho --info "List Xen domains" echo techo --begin '5r 6r 1 7 50' techo --info --row no. order "" booted name idx=0 if ls ${domUConfigfile}_[0-9][0-9]_* >/dev/null 2>&1 then for dom in ${domUConfigfile}_* do let idx++ name=`echo $dom | sed 's#^'${domUConfigfile}'_[0-9][0-9]_##'` if ls $domUConfigfile$delimiter$name >/dev/null 2>&1 then bootOrder=`echo $dom | sed -e 's#^[^0-9]*_##' -e 's#_'$name'$##'` checkIfVMIsUp $name # returns $isUp=true if running techo --row "$idx " "- $bootOrder" "" "`${isUp:-false} && echo yes || echo no`" "$name" echo "$idx $bootOrder $name" >>$varrun else remove "${domUConfigfile}_[0-9][0-9]_$name" fi done techo --end else techo --row "" "" "" "" "No domains created, yet" techo --end if /var/install/bin/ask --tty --info "Dou you want to create one" then /bin/sh /var/install/bin/xen-create-domain continue fi fi echo mecho -n "Enter command ([${_INFO}1$_RESET" if [ $idx -gt 1 ] then mecho -n "-$_INFO$idx$_RESET" fi mecho -n "] to manage the domain, ${_INFO}ENTER$_RESET=Return): " read domid case "$domid" in "") break ;; [1-9] | [1-9][0-9]) [ $domid -le $idx ] || break clrhome eval name="\`awk '\$1 == $domid { print \$3 }' \$varrun\`" /var/install/bin/xen-maintain-domain manage_domain $name xendIsRuning ;; esac done #set +x