From 6cb42565f2c9d9ac4fbaf8c1ec0b4a96d5222763 Mon Sep 17 00:00:00 2001 From: Josh King Date: Wed, 13 Aug 2014 15:25:31 -0400 Subject: [PATCH 1/3] Updating commotion-debug-helper to use iw instead of iwinfo and nodogsplash instead of luci_splash. --- files/usr/sbin/cdh.sh | 46 +++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/files/usr/sbin/cdh.sh b/files/usr/sbin/cdh.sh index 9053679..193e655 100755 --- a/files/usr/sbin/cdh.sh +++ b/files/usr/sbin/cdh.sh @@ -119,7 +119,8 @@ network() echo -e "---------------Smart Gateway Default Route---------------------" >> $FILE ip route ls table 224 >> $FILE - radio scan + dev scan + dev station dump } rules() @@ -139,11 +140,8 @@ rules() flair "UCI Firewall Current State: (uci show -p /var/state firewall)" uci show -p /var/state firewall >> $FILE - flair "UCI Splash Info:(uci show luci_splash)" - uci show luci_splash >> $FILE - - flair "UCI Splash Current State:(uci show -p /var/state luci_splash)" - uci show -p /var/state luci_splash >> $FILE + flair "Nodogsplash Info:(ndsctl status)" + ndsctl status >> $FILE } state() @@ -166,23 +164,45 @@ state() flair "Router uptime and Load: (uptime)" uptime >> $FILE - radio info - + phy info + dev info + dev link } #====================================================== # radio identifier and Scanner #======================================================= -radio() +dev() +{ + local i=0 + local DEV= + while [ $? -eq 0 ] + do + DEV=`uci -P /var/state -q get wireless.@wifi-iface[$i].ifname` + if [ $? -eq 0 ] + then + flair "$DEV $1" + iw dev $DEV $@ >> $FILE + i=$(($i+1)) + elif [ $? -eq 1 ] + then + break + exit 0 + fi + done +} + +phy() { - i=1 + local i=0 + local PHY= while [ $? -eq 0 ] do - RADIO=`uci -q get wireless.@wifi-iface[$i].device` + PHY=`uci -q get wireless.@wifi-device[$i]` if [ $? -eq 0 ] then - flair "$RADIO $1" - iwinfo $RADIO $1 >> $FILE + flair "phy$i $1" + iw phy phy$i $@ >> $FILE i=$(($i+1)) elif [ $? -eq 1 ] then From 66664a501b99f181e476caa991095b9e715fd49c Mon Sep 17 00:00:00 2001 From: Josh King Date: Wed, 13 Aug 2014 17:00:38 -0400 Subject: [PATCH 2/3] Fix use of http.getenv in commotion-debug-helper web interface. --- luasrc/controller/commotion/debugger.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luasrc/controller/commotion/debugger.lua b/luasrc/controller/commotion/debugger.lua index 59a1471..ad64fca 100644 --- a/luasrc/controller/commotion/debugger.lua +++ b/luasrc/controller/commotion/debugger.lua @@ -73,7 +73,7 @@ function data() f:close() end end - old_uri = env.REQUEST_URI + old_uri = luci.http.getenv("REQUEST_URI") uri = string.gsub(old_uri, "debug/submit", "debug") - http.redirect("https://"..env.SERVER_NAME..uri) + http.redirect("https://"..luci.http.getenv("SERVER_NAME")..uri) end From 0930774d8103d12589e9d5785e84980397e2be2d Mon Sep 17 00:00:00 2001 From: Josh King Date: Wed, 13 Aug 2014 17:01:28 -0400 Subject: [PATCH 3/3] Rename cdh.sh to cdh as luci interface expects. --- files/usr/sbin/{cdh.sh => cdh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename files/usr/sbin/{cdh.sh => cdh} (100%) diff --git a/files/usr/sbin/cdh.sh b/files/usr/sbin/cdh similarity index 100% rename from files/usr/sbin/cdh.sh rename to files/usr/sbin/cdh