Advertisement
Guest User

gluon airtime

a guest
May 25th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. Geht nur unter Gluon <= 2015.1.2
  2.  
  3. im cronjob
  4. ----------------------------------------
  5. */1 * * * * /root/airtime.sh
  6. ----------------------------------------
  7.  
  8.  
  9.  
  10.  
  11. in /root/airtime.sh
  12. ----------------------------------------
  13. #!/bin/sh
  14. iw dev client0 survey dump > /24dump
  15. iw dev client1 survey dump > /5dump
  16. cat /24dump | sed '/Survey/,/\[in use\]/d' > /24reduced
  17. ACT_CUR=$(ACTIVE=$(cat /24reduced | grep "active time:"); set ${ACTIVE:-0 0 0 0 0}; echo -e "${4}")
  18. BUS_CUR=$(BUSY=$(cat /24reduced | grep "busy time:"); set ${BUSY:-0 0 0 0 0}; echo -e "${4}")
  19. echo $ACT_CUR > /act2
  20. echo $BUS_CUR > /bus2
  21. cat /5dump | sed '/Survey/,/\[in use\]/d' > /5reduced
  22. ACT_CUR=$(ACTIVE=$(cat /5reduced | grep "active time:"); set ${ACTIVE:-0 0 0 0 0}; echo -e "${4}")
  23. BUS_CUR=$(BUSY=$(cat /5reduced | grep "busy time:"); set ${BUSY:-0 0 0 0 0}; echo -e "${4}")
  24. echo $ACT_CUR > /act5
  25. echo $BUS_CUR > /bus5
  26. ----------------------------------------
  27.  
  28.  
  29.  
  30. Ordner erstellen:
  31. ----------------------------------------
  32. /lib/gluon/announce/nodeinfo.d/wireless
  33. ----------------------------------------
  34.  
  35. Dort folgende Dateien erstellen:
  36.  
  37. Für die Airtime:
  38. ----------------------------------------
  39.  
  40. 2,4 ghz
  41.  
  42. airtime2 (Dateiname)
  43.  
  44. local n = 0
  45. local act = util.trim(fs.readfile('/act2'))
  46. n = tonumber(act)
  47. local bus = util.trim(fs.readfile('/bus2'))
  48. m = tonumber(bus)
  49. string.format("%.2f", m / m)
  50. return (m /n)
  51.  
  52.  
  53.  
  54. 5 ghz
  55.  
  56. airtime5 (Dateiname)
  57.  
  58. local n = 0
  59. local act = util.trim(fs.readfile('/act5'))
  60. n = tonumber(act)
  61. local bus = util.trim(fs.readfile('/bus5'))
  62. m = tonumber(bus)
  63. string.format("%.2f", m / m)
  64. return (m /n)
  65.  
  66. ----------------------------------------
  67.  
  68. Für die Kanalanzeige:
  69. ----------------------------------------
  70.  
  71. chan2
  72.  
  73. local wifitwo = uci:get('wireless', 'radio0', 'channel')
  74. if wifitwo ~= '' then
  75. return wifitwo
  76. end
  77.  
  78. chan5
  79.  
  80. local wififive = uci:get('wireless', 'radio1', 'channel')
  81. if wififive ~= '' then
  82. return wififive
  83. end
  84.  
  85.  
  86.  
  87. ----------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement