Add scripts to make host nums file
This commit is contained in:
parent
b66bf4d8d3
commit
4b799bb44b
3 changed files with 31 additions and 4 deletions
16
acatcher/mkhosts
Executable file
16
acatcher/mkhosts
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
NUM=0
|
||||
while read FOO; do
|
||||
if ! echo $FOO | grep -q ^#; then
|
||||
HOST="`echo $FOO | cut -d\| -f3`"
|
||||
IP="`echo $FOO | cut -d\| -f2`"
|
||||
if ! echo $HOST | egrep -q "(server|spare)"; then
|
||||
>&2 echo found host $HOST ip $IP num $NUM
|
||||
echo "$HOST:$IP:$NUM"
|
||||
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 > HOSTS
|
Loading…
Add table
Add a link
Reference in a new issue