xentaur

view files/xenomips.sh @ 66:aaf034af3a35

Merge of Xgurulla into Xentaur code. Not completed yet!!!

Now Xentaur can work with Amazon EC2,
but only with. Local domains management
is switched off temporarily.
author Igor Chubin <igor@chub.in>
date Sat Jan 09 20:20:08 2010 +0200 (2010-01-09)
parents 6471afbee150
children
line source
1 #!/bin/sh
3 XENOMIPS=''
4 grep -qi xenomips /proc/cmdline && XENOMIPS=`cat /proc/cmdline | sed 's/.*xenomips="//; s/".*//'`
6 case $1 in
7 start)
8 [ -e /dev/hvc0 ] || ln -s /dev/null /dev/hvc0
9 if grep -qi xenomips /proc/cmdline
10 then
11 WORKDIR="/xenomips/config/dynamips"
12 if echo $XENOMIPS | grep -q ^./pemu
13 then
14 WORKDIR="/xenomips/config/pixemu"
15 PIXOS=`echo $XENOMIPS | sed 's/.* //'`
16 XENOMIPS=`echo $XENOMIPS | sed 's/ [^ ]*$//'`
17 cp /xenomips/config/pixemu/pemu.ini.ORIG /xenomips/config/pixemu/pemu.ini
18 sed -i -e "s@FLASH@$PIXOS@" /xenomips/config/pixemu/pemu.ini
19 fi
20 cd "$WORKDIR"
21 screen -e '^xx' -d -m sh -c "while true; do $XENOMIPS ; done"
22 else
23 /etc/init.d/quagga start
24 screen -e '^xx' -d -m sh -c 'while true; do vtysh; done'
25 fi
26 ;;
27 stop)
28 if grep -qi xenomips /proc/cmdline
29 then
30 kill $(ps aux | egrep "pemu|dynamips" | awk '{print $2}')
31 else
32 /etc/init.d/quagga stop
33 fi
34 ;;
35 esac