xentaur
annotate files/xenomips.sh @ 54:0d56a515a5f6
+netcat+socat to xenomips
author | igor |
---|---|
date | Thu Oct 25 21:43:58 2007 +0300 (2007-10-25) |
parents | de23c23ef4ac |
children | 6471afbee150 |
rev | line source |
---|---|
igor@0 | 1 #!/bin/sh |
igor@0 | 2 |
igor@49 | 3 case $1 in |
igor@49 | 4 start) |
igor@49 | 5 if grep -qi xenomips /proc/cmdline |
igor@49 | 6 then |
igor@49 | 7 DYNAMIPS_WORKDIR="/xenomips/config" |
igor@49 | 8 DYNAMIPS_ARGS=`cat /proc/cmdline | sed 's/.*xenomips="//; s/".*//'` |
igor@49 | 9 cd "$DYNAMIPS_WORKDIR" |
igor@49 | 10 screen -e '^xx' -d -m sh -c "while true; do dynamips $DYNAMIPS_ARGS ; done" |
igor@49 | 11 else |
igor@49 | 12 /etc/init.d/quagga start |
igor@49 | 13 screen -e '^xx' -d -m sh -c 'while true; do vtysh; done' |
igor@49 | 14 fi |
igor@49 | 15 ;; |
igor@49 | 16 stop) |
igor@49 | 17 if grep -qi xenomips /proc/cmdline |
igor@49 | 18 then |
igor@49 | 19 kill $(ps aux | grep dynamips | awk '{print $2}') |
igor@49 | 20 else |
igor@49 | 21 /etc/init.d/quagga stop |
igor@49 | 22 fi |
igor@49 | 23 ;; |
igor@49 | 24 esac |
igor@0 | 25 |