xentaur

annotate files/xenomips.sh @ 64:baf0c3300c19

update tags
author convert-repo
date Sun Jun 29 09:03:52 2008 +0000 (2008-06-29)
parents 65e80fabc89c
children cf823d27b029
rev   line source
igor@0 1 #!/bin/sh
igor@0 2
igor@61 3 XENOMIPS=''
igor@61 4 grep -qi xenomips /proc/cmdline && XENOMIPS=`cat /proc/cmdline | sed 's/.*xenomips="//; s/".*//'`
igor@61 5
igor@49 6 case $1 in
igor@49 7 start)
igor@49 8 if grep -qi xenomips /proc/cmdline
igor@49 9 then
igor@61 10 WORKDIR="/xenomips/config/dynamips"
igor@61 11 if echo $XENOMIPS | grep -q ^./pemu
igor@61 12 then
igor@61 13 WORKDIR="/xenomips/config/pixemu"
igor@61 14 PIXOS=`echo $XENOMIPS | sed 's/.* //'`
igor@61 15 XENOMIPS=`echo $XENOMIPS | sed 's/ [^ ]*$//'`
igor@61 16 cp /xenomips/config/pixemu/pemu.ini.ORIG /xenomips/config/pixemu/pemu.ini
igor@61 17 sed -i -e "s@FLASH@$PIXOS@" /xenomips/config/pixemu/pemu.ini
igor@61 18 fi
igor@61 19 cd "$WORKDIR"
igor@61 20 screen -e '^xx' -d -m sh -c "while true; do $XENOMIPS ; done"
igor@49 21 else
igor@49 22 /etc/init.d/quagga start
igor@49 23 screen -e '^xx' -d -m sh -c 'while true; do vtysh; done'
igor@49 24 fi
igor@49 25 ;;
igor@49 26 stop)
igor@49 27 if grep -qi xenomips /proc/cmdline
igor@49 28 then
igor@61 29 kill $(ps aux | egrep "pemu|dynamips" | awk '{print $2}')
igor@49 30 else
igor@49 31 /etc/init.d/quagga stop
igor@49 32 fi
igor@49 33 ;;
igor@49 34 esac
igor@0 35