Skip to content

Commit

Permalink
Merge pull request #407 from opentechinstitute/cdh-fixes
Browse files Browse the repository at this point in the history
Updating commotion-debug-helper to not use iwinfo or luci_splash. Made changes based on testing, tested by @hawkinswnaf and merged by @jheretic.
  • Loading branch information
jheretic committed Aug 13, 2014
2 parents e650868 + 0930774 commit a157701
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 15 deletions.
46 changes: 33 additions & 13 deletions files/usr/sbin/cdh.sh → files/usr/sbin/cdh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions luasrc/controller/commotion/debugger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a157701

Please sign in to comment.