Add shells cripts
This commit is contained in:
parent
7e6fc09f72
commit
a96d932c14
7 changed files with 102 additions and 0 deletions
17
acatcher/stop_streamers.sh
Executable file
17
acatcher/stop_streamers.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
NUM=0
|
||||
while read FOO; do
|
||||
if ! echo $FOO | grep -q ^#; then
|
||||
HOST="`echo $FOO | cut -d\| -f3`"
|
||||
MAC="`echo $FOO | cut -d\| -f1 | tr '[A-Z]' '[a-z]'`"
|
||||
IP="`echo $FOO | cut -d\| -f2`"
|
||||
if ! echo $HOST | egrep -q "(server|spare)"; then
|
||||
>&2 echo killing host $HOST mac $MAC ip $IP num $NUM
|
||||
ssh pi@$HOST "screen -X quit"
|
||||
NUM=$((NUM+1))
|
||||
elif echo $HOST | grep -q server; then
|
||||
>&2 echo found server at ip $IP
|
||||
echo $IP > SERVERIP
|
||||
fi
|
||||
fi
|
||||
done < $HOME/Dropbox/CAMS
|
Loading…
Add table
Add a link
Reference in a new issue