Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Geht nur unter Gluon <= 2015.1.2
- im cronjob
- ----------------------------------------
- */1 * * * * /root/airtime.sh
- ----------------------------------------
- in /root/airtime.sh
- ----------------------------------------
- #!/bin/sh
- iw dev client0 survey dump > /24dump
- iw dev client1 survey dump > /5dump
- cat /24dump | sed '/Survey/,/\[in use\]/d' > /24reduced
- ACT_CUR=$(ACTIVE=$(cat /24reduced | grep "active time:"); set ${ACTIVE:-0 0 0 0 0}; echo -e "${4}")
- BUS_CUR=$(BUSY=$(cat /24reduced | grep "busy time:"); set ${BUSY:-0 0 0 0 0}; echo -e "${4}")
- echo $ACT_CUR > /act2
- echo $BUS_CUR > /bus2
- cat /5dump | sed '/Survey/,/\[in use\]/d' > /5reduced
- ACT_CUR=$(ACTIVE=$(cat /5reduced | grep "active time:"); set ${ACTIVE:-0 0 0 0 0}; echo -e "${4}")
- BUS_CUR=$(BUSY=$(cat /5reduced | grep "busy time:"); set ${BUSY:-0 0 0 0 0}; echo -e "${4}")
- echo $ACT_CUR > /act5
- echo $BUS_CUR > /bus5
- ----------------------------------------
- Ordner erstellen:
- ----------------------------------------
- /lib/gluon/announce/nodeinfo.d/wireless
- ----------------------------------------
- Dort folgende Dateien erstellen:
- Für die Airtime:
- ----------------------------------------
- 2,4 ghz
- airtime2 (Dateiname)
- local n = 0
- local act = util.trim(fs.readfile('/act2'))
- n = tonumber(act)
- local bus = util.trim(fs.readfile('/bus2'))
- m = tonumber(bus)
- string.format("%.2f", m / m)
- return (m /n)
- 5 ghz
- airtime5 (Dateiname)
- local n = 0
- local act = util.trim(fs.readfile('/act5'))
- n = tonumber(act)
- local bus = util.trim(fs.readfile('/bus5'))
- m = tonumber(bus)
- string.format("%.2f", m / m)
- return (m /n)
- ----------------------------------------
- Für die Kanalanzeige:
- ----------------------------------------
- chan2
- local wifitwo = uci:get('wireless', 'radio0', 'channel')
- if wifitwo ~= '' then
- return wifitwo
- end
- chan5
- local wififive = uci:get('wireless', 'radio1', 'channel')
- if wififive ~= '' then
- return wififive
- end
- ----------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement