debuggers.hg

view tools/control/xenctl @ 644:5e169da77286

bitkeeper revision 1.339 (3f0d6d60VROcPVK9573_fpTcuFCUXg)

Rename domctl.xml to xenctl.xml
author rac61@labyrinth.cl.cam.ac.uk
date Thu Jul 10 13:42:56 2003 +0000 (2003-07-10)
parents a50c94715247
children c336be9fa2b2 ad58e3192187
line source
1 #!/bin/bash
3 if [ -z "$DEFAULTS_FILE" ] ; then DEFAULTS_FILE=xenctl.xml ; fi
4 if [ -z "$DEFAULTS_PATH" ] ; then DEFAULTS_PATH=.:/etc:/var/lib/xen ; fi
5 if [ -z "$QUERY_DEV" ] ; then QUERY_DEV=eth0 ; fi
6 if [ -z "$IFCONFIG" ] ; then IFCONFIG=/sbin/ifconfig ; fi
7 if [ -z "$ROUTE" ] ; then ROUTE=/sbin/route ; fi
8 if [ -z "$JAVA" ] ; then JAVA=java ; fi
10 if [ "$1" = "domain" -a "$2" = "new" ] ; then
11 if [ ! -x "$IFCONFIG" ]; then
12 echo Could not find executable $IFCONFIG
13 exit 1
14 fi
16 if [ ! -x "$ROUTE" ]; then
17 echo Could not find executable $ROUTE
18 exit 1
19 fi
21 # Try to determine dom0 network settings to avoid hard-coding
22 # particular machines in the defaults file
23 LOCAL_IP=$(/sbin/ifconfig $QUERY_DEV | grep 'inet addr' | tr ':' '\t' | awk '{print $3}')
24 LOCAL_MASK=$(/sbin/ifconfig $QUERY_DEV | grep 'Mask' | tr ':' '\t' | awk '{print $7}')
25 LOCAL_ROUTE=$(/sbin/route -n | grep $QUERY_DEV | grep 'G' | awk '{print $2}')
26 fi
29 #ARGS="-DTEST -DDEFAULTS_FILE=$DEFAULTS_FILE -DDEFAULTS_PATH=$DEFAULTS_PATH -DLOCAL_IP=$LOCAL_IP -DLOCAL_MASK=$LOCAL_MASK -DLOCAL_ROUTE=$LOCAL_ROUTE"
30 ARGS="-DDEFAULTS_FILE=$DEFAULTS_FILE -DDEFAULTS_PATH=$DEFAULTS_PATH -DLOCAL_IP=$LOCAL_IP -DLOCAL_MASK=$LOCAL_MASK -DLOCAL_ROUTE=$LOCAL_ROUTE"
33 $JAVA $ARGS -jar $(dirname $0)/xenctl-cmdline.jar $*