xentaur
diff files/xenomips.sh @ 51:b9536e00100a
exec timeout 0
author | igor |
---|---|
date | Thu Oct 25 21:27:01 2007 +0300 (2007-10-25) |
parents | de23c23ef4ac |
children | 6471afbee150 |
line diff
1.1 --- a/files/xenomips.sh Fri Sep 14 12:59:55 2007 +0300 1.2 +++ b/files/xenomips.sh Thu Oct 25 21:27:01 2007 +0300 1.3 @@ -1,13 +1,25 @@ 1.4 #!/bin/sh 1.5 1.6 -if grep -qi xenomips /proc/cmdline 1.7 -then 1.8 - DYNAMIPS_WORKDIR="/xenomips/config" 1.9 - DYNAMIPS_ARGS=`cat /proc/cmdline | sed 's/.*xenomips="//; s/".*//'` 1.10 - cd "$DYNAMIPS_WORKDIR" 1.11 - screen -e '^xx' -d -m sh -c "while true; do dynamips $DYNAMIPS_ARGS ; done" 1.12 -else 1.13 - /etc/init.d/quagga start 1.14 - screen -e '^xx' -d -m sh -c 'while true; do vtysh; done' 1.15 -fi 1.16 +case $1 in 1.17 + start) 1.18 + if grep -qi xenomips /proc/cmdline 1.19 + then 1.20 + DYNAMIPS_WORKDIR="/xenomips/config" 1.21 + DYNAMIPS_ARGS=`cat /proc/cmdline | sed 's/.*xenomips="//; s/".*//'` 1.22 + cd "$DYNAMIPS_WORKDIR" 1.23 + screen -e '^xx' -d -m sh -c "while true; do dynamips $DYNAMIPS_ARGS ; done" 1.24 + else 1.25 + /etc/init.d/quagga start 1.26 + screen -e '^xx' -d -m sh -c 'while true; do vtysh; done' 1.27 + fi 1.28 + ;; 1.29 + stop) 1.30 + if grep -qi xenomips /proc/cmdline 1.31 + then 1.32 + kill $(ps aux | grep dynamips | awk '{print $2}') 1.33 + else 1.34 + /etc/init.d/quagga stop 1.35 + fi 1.36 + ;; 1.37 +esac 1.38