xentaur

view files/xenomips.sh @ 61:6471afbee150

*** empty log message ***
author igor
date Mon Dec 03 08:36:13 2007 +0200 (2007-12-03)
parents 65e80fabc89c
children cf823d27b029
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 if grep -qi xenomips /proc/cmdline
9 then
10 WORKDIR="/xenomips/config/dynamips"
11 if echo $XENOMIPS | grep -q ^./pemu
12 then
13 WORKDIR="/xenomips/config/pixemu"
14 PIXOS=`echo $XENOMIPS | sed 's/.* //'`
15 XENOMIPS=`echo $XENOMIPS | sed 's/ [^ ]*$//'`
16 cp /xenomips/config/pixemu/pemu.ini.ORIG /xenomips/config/pixemu/pemu.ini
17 sed -i -e "s@FLASH@$PIXOS@" /xenomips/config/pixemu/pemu.ini
18 fi
19 cd "$WORKDIR"
20 screen -e '^xx' -d -m sh -c "while true; do $XENOMIPS ; done"
21 else
22 /etc/init.d/quagga start
23 screen -e '^xx' -d -m sh -c 'while true; do vtysh; done'
24 fi
25 ;;
26 stop)
27 if grep -qi xenomips /proc/cmdline
28 then
29 kill $(ps aux | egrep "pemu|dynamips" | awk '{print $2}')
30 else
31 /etc/init.d/quagga stop
32 fi
33 ;;
34 esac