summaryrefslogtreecommitdiff
path: root/files/common/etc/fsm/inetable/common_queen.sh
blob: 1f66c68a3e5568bdb3d8bf438c34d3b01f736a87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# functions that are allowed to be called if we are in the queen or
# ghost state

gwiptbl=/tmp/p2ptbl/gwip
DHCPLeaseTime=$((12 * 3600))

NodeId="$(cat /etc/nodeid)"
oct3=$(ifconfig br-mesh | egrep -o 'inet addr:[0-9.]*'|cut -f3 -d.)
[ -n "$oct3" ]
gwip=$(ipcalc.sh "$(uci get cloud.cur.net_mesh)" $(($oct3 * 256 + 1)) 1 \
     | grep ^START | cut -f2 -d=)

we_own_our_ip () {
    [ "$(p2ptbl get $gwiptbl $oct3 | cut -sf2)" == "$NodeId" ]
}
contact: Jan Huwald // Impressum