-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathannounce.sh
executable file
·44 lines (41 loc) · 1.02 KB
/
announce.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
DIR="$(dirname "$0")"
while test $# -gt 0; do
case $1 in
-i)
shift
ip link show dev $1 > /dev/null
test $? -ne 0 && exit
INTERFACE="-i $1"
;;
-b)
shift
ip link show dev $1 > /dev/null
test $? -ne 0 && exit
BATADV="-b $1"
;;
-f)
shift
ip link show dev $1 > /dev/null
test $? -ne 0 && exit
FASTD="-f $1"
;;
-u)
shift
alfred-json -z -r 158 -s $1 > /dev/null
test $? -ne 0 && exit
ALFREDSOCKET="-u $1"
;;
-s)
shift
SITECODE="-s $1"
;;
-h|--help)
echo "Usage: $0 [-i <ifname>] [-b <batadv-dev>] [-f <fastd-dev>] [-u <alfred-socket>] [-s <site_code>]"
exit
;;
esac
shift
done
"${DIR}"/announce.py -d "${DIR}"/nodeinfo.d/ ${INTERFACE} ${BATADV} ${FASTD} ${SITECODE} | gzip | alfred $ALFREDSOCKET $INTERFACE -s 158
"${DIR}"/announce.py -d "${DIR}"/statistics.d/ ${INTERFACE} ${BATADV} ${FASTD} ${SITECODE} | gzip | alfred $ALFREDSOCKET $INTERFACE -s 159