xentaur

annotate files/xenomips.sh @ 68:f652fab38c7a

ec2 parameters small fixes
author Igor Chubin <igor@chub.in>
date Mon Jan 11 19:36:56 2010 +0200 (2010-01-11)
parents 6471afbee150
children
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)
nata@65 8 [ -e /dev/hvc0 ] || ln -s /dev/null /dev/hvc0
igor@49 9 if grep -qi xenomips /proc/cmdline
igor@49 10 then
igor@61 11 WORKDIR="/xenomips/config/dynamips"
igor@61 12 if echo $XENOMIPS | grep -q ^./pemu
igor@61 13 then
igor@61 14 WORKDIR="/xenomips/config/pixemu"
igor@61 15 PIXOS=`echo $XENOMIPS | sed 's/.* //'`
igor@61 16 XENOMIPS=`echo $XENOMIPS | sed 's/ [^ ]*$//'`
igor@61 17 cp /xenomips/config/pixemu/pemu.ini.ORIG /xenomips/config/pixemu/pemu.ini
igor@61 18 sed -i -e "s@FLASH@$PIXOS@" /xenomips/config/pixemu/pemu.ini
igor@61 19 fi
igor@61 20 cd "$WORKDIR"
igor@61 21 screen -e '^xx' -d -m sh -c "while true; do $XENOMIPS ; done"
igor@49 22 else
igor@49 23 /etc/init.d/quagga start
igor@49 24 screen -e '^xx' -d -m sh -c 'while true; do vtysh; done'
igor@49 25 fi
igor@49 26 ;;
igor@49 27 stop)
igor@49 28 if grep -qi xenomips /proc/cmdline
igor@49 29 then
igor@61 30 kill $(ps aux | egrep "pemu|dynamips" | awk '{print $2}')
igor@49 31 else
igor@49 32 /etc/init.d/quagga stop
igor@49 33 fi
igor@49 34 ;;
igor@49 35 esac
igor@0 36