2012-02-17 02:09:21 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-06-06 02:21:59 +02:00
|
|
|
set -e
|
|
|
|
|
2012-02-17 02:09:21 +01:00
|
|
|
DEST=$1
|
|
|
|
|
|
|
|
|
2012-06-06 02:21:59 +02:00
|
|
|
[ "$DEST" ] || exit 1
|
|
|
|
|
|
|
|
|
2012-06-06 01:58:31 +02:00
|
|
|
GWL=`batctl gwl -n`
|
2012-02-17 02:09:21 +01:00
|
|
|
|
2012-06-06 01:58:31 +02:00
|
|
|
SELF=`echo "$GWL" | head -n 1 | sed -r -e 's@^.*MainIF/MAC: [^/]+/([0-9a-f:]+).*$@\1@'`
|
|
|
|
GWS=`(echo "$GWL" | tail -n +2 | grep -v '^No' | sed 's/=>//' | awk '{ print $1 }') | while read a; do echo -n "-g $a "; done`
|
|
|
|
|
|
|
|
if [ `cat /sys/class/net/bat0/mesh/gw_mode` = server ]; then
|
|
|
|
GWS="$GWS -g $SELF"
|
|
|
|
fi
|
|
|
|
|
2013-02-02 01:21:29 +01:00
|
|
|
"$(dirname "$0")"/ffhlwiki.py http://freifunk.metameute.de/wiki/Knoten > "$(dirname "$0")"/aliases_hl.json
|
|
|
|
"$(dirname "$0")"/ffhlwiki.py http://freifunk.metameute.de/wiki/Moelln:Knoten > "$(dirname "$0")"/aliases_moelln.json
|
|
|
|
|
|
|
|
batctl vd json | "$(dirname "$0")"/bat2nodes.py -a "$(dirname "$0")"/aliases.json -a aliases_hl.json -a aliases_moelln.json $GWS - > $DEST/nodes.json.new
|
2012-05-12 16:44:27 +02:00
|
|
|
|
|
|
|
mv $DEST/nodes.json.new $DEST/nodes.json
|
2012-02-17 02:09:21 +01:00
|
|
|
|