Make autogen

This commit is contained in:
Donald Burr 2015-02-18 00:58:25 -08:00
parent 9a00ee2118
commit f36be74fe5
3 changed files with 35 additions and 16 deletions

1
acatcher/.gitignore vendored
View file

@ -1,4 +1,5 @@
acatcher
*.o
*.inc
HOSTS
SERVERIP

View file

@ -42,22 +42,22 @@ using namespace std;
const int MAX = 16;
const char *names[] = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"A",
"B",
"C",
"D",
"E",
"F",
"[0] mon-century-ab",
"[1] mon-century-cd",
"[2] mon-lajolla",
"[3] mon-carmel",
"[4] mon-losangeles-a",
"[5] mon-losangeles-b",
"[6] mon-losangeles-c",
"[7] mon-marina",
"[8] mon-belair",
"[9] mon-sanlorenzo-d",
"[a] mon-sanlorenzo-e",
"[b] mon-sanlorenzo-f",
"[c] mon-plaza-bc",
"[d] mon-plaza-d",
"[e] mon-internationallballroom",
"[f] mon-pacificballroom",
};
void cls()

18
acatcher/mkacatcher Executable file
View file

@ -0,0 +1,18 @@
#!/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 found host $HOST mac $MAC ip $IP num $NUM
HEX="`echo "obase=16; $NUM" | bc | tr '[A-Z]' '[a-z]'`"
echo "\"[$HEX] $HOST\","
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 > acatcher.cxx.inc