1 | 1 | simandl | #!/bin/sh |
2 | | | |
3 | | | # (c)2003 by Jan Krupa (krupaj@mobilnews.cz) |
4 | | | # http://www.mobilnews.cz/honza/ |
5 | | | |
6 | | | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin |
7 | | | export PATH |
8 | | | |
9 | | | STATS_PATH=/home/www/cgi-bin/netmap |
10 | | | STATS_PATH_DATA=$STATS_PATH/data |
11 | | | |
12 | 93 | simandl | NAME=jablonecka |
13 | 1 | simandl | |
14 | 93 | simandl | DATABASE=$STATS_PATH_DATA/$NAME.link |
15 | | | |
16 | 105 | simandl | $STATS_PATH/gen_ospf_link.pl \ |
17 | 133 | simandl | | grep -Ev "infinity|atom|10.33|vpnserver|db.jablonka|olive|hexa|virtuozzo|sitelka" \ |
18 | 105 | simandl | > $DATABASE.ospf |
19 | | | |
20 | 119 | simandl | |
21 | | | # |
22 | | | # jikos: |
23 | | | # check if there is any of the [jabu,hasit,jab715 ; jgw,ogw,sitelka] links alive |
24 | | | # (workaround for the script not being able to cope with 3Way/DRother links) |
25 | | | # |
26 | | | # sitelka is the Full/DR one |
27 | 132 | simandl | grep -E '92;hasit;sitelka|92;jab715;sitelka' $DATABASE.ospf >/dev/null 2>&1 |
28 | 119 | simandl | if [ $? -eq 0 ]; then |
29 | 132 | simandl | cat $DATABASE.ospf | grep -Ev '82;hasit;jgw|82;hasit;ogw;|82;jab715;jgw;|82;jab715;ogw;' > $DATABASE.ospfA |
30 | 119 | simandl | mv $DATABASE.ospfA $DATABASE.ospf |
31 | | | fi |
32 | | | # jgw is the Full/DR one |
33 | 132 | simandl | grep -E '92;jab715;jgw|92;hasit;jgw' $DATABASE.ospf >/dev/null 2>&1 |
34 | 119 | simandl | if [ $? -eq 0 ]; then |
35 | 132 | simandl | cat $DATABASE.ospf | grep -Ev '82;hasit;sitelka|82;hasit;ogw;|82;jab715;sitelka;|82;jab715;ogw;|82;hasit;jab715;' > $DATABASE.ospfA |
36 | 119 | simandl | mv $DATABASE.ospfA $DATABASE.ospf |
37 | | | fi |
38 | | | # ogw is the Full/DR one |
39 | 132 | simandl | grep -E '92;jab715;ogw|92;ogw;hasit' $DATABASE.ospf >/dev/null 2>&1 |
40 | 119 | simandl | if [ $? -eq 0 ]; then |
41 | 132 | simandl | cat $DATABASE.ospf | grep -Ev '82;hasit;sitelka|82;hasit;jgw;|82;jab715;sitelka;|82;jab715;jgw;' > $DATABASE.ospfA |
42 | 119 | simandl | mv $DATABASE.ospfA $DATABASE.ospf |
43 | | | fi |
44 | 132 | simandl | # jab414 is the Full/DR one |
45 | | | grep -E '92;jab414;jgw|92;jab414;ogw' $DATABASE.ospf >/dev/null 2>&1 |
46 | | | if [ $? -eq 0 ]; then |
47 | | | cat $DATABASE.ospf | grep -Ev '82;hasit;jgw;' > $DATABASE.ospfA |
48 | | | mv $DATABASE.ospfA $DATABASE.ospf |
49 | | | fi |
50 | 119 | simandl | |
51 | 132 | simandl | # |
52 | | | # jikos: remove some confusing / temporary peers (routers with not regular router-id) |
53 | | | # |
54 | | | # |
55 | | | cat $DATABASE.ospf | grep -Ev 'jabtv|arista-test|jablonecka' > $DATABASE.ospfA |
56 | | | mv $DATABASE.ospfA $DATABASE.ospf |
57 | 119 | simandl | |
58 | 29 | simandl | cat $DATABASE.basic | grep -v "^00" > $DATABASE |
59 | 1 | simandl | cat $DATABASE.ospf >> $DATABASE |
60 | | | |
61 | | | |
62 | | | for LINE in `/bin/ls -1 $STATS_PATH_DATA | /bin/grep .config`; do |
63 | | | $STATS_PATH/gen_onestatpict `/bin/echo $LINE | /bin/awk -F. '{ printf "%s", $1 }'` &>/dev/null |
64 | | | done |
65 | | | |
66 | 30 | simandl | convert /home/www/html/netmap/out/jablonecka.png -resize 160x95 /home/www/html/wm/images/prosek_netmap.png |
67 | 60 | simandl | convert /home/www/html/netmap/out/jablonecka.png -resize 660x440 /home/www/html/wm/images/netmap.jpg |
68 | 30 | simandl | |