mirror of https://github.com/aredn/aredn.git
Merge branch 'develop' of ssh://git.aredn.org/aredn_ar71xx into develop
This commit is contained in:
commit
bcef55c807
|
@ -3,3 +3,4 @@
|
|||
/cgi-bin/admin:root:hsmm
|
||||
/cgi-bin/vpn:root:hsmm
|
||||
/cgi-bin/vpnc:root:hsmm
|
||||
/cgi-bin/supporttool:root:hsmm
|
||||
|
|
|
@ -627,6 +627,12 @@ print "</tr>\n";
|
|||
print "</table></td></tr>\n";
|
||||
|
||||
print "<tr><td colspan=3><hr></td></tr>\n";
|
||||
|
||||
print "<tr><th colspan=3>Support Data</th></tr>\n";
|
||||
print "<tr><td colspan=3 align=center><a href=/cgi-bin/supporttool>Download Support Data</a></td></tr>\n";
|
||||
|
||||
print "<tr><td colspan=3><hr></td></tr>\n";
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print "</td></tr>\n";
|
||||
|
|
|
@ -49,6 +49,9 @@ sub rf_channel_map
|
|||
7 => "(922)",
|
||||
},
|
||||
'2400' => {
|
||||
-2 => "-2 (2397)",
|
||||
-1 => "-1 (2402)",
|
||||
0 => "0 (2407)",
|
||||
1 => "1 (2412)",
|
||||
2 => "2 (2417)",
|
||||
3 => "3 (2422)",
|
||||
|
@ -62,11 +65,30 @@ sub rf_channel_map
|
|||
11 => "11 (2462)",
|
||||
},
|
||||
'3400' => {
|
||||
95 => "(3475)",
|
||||
96 => "(3480)",
|
||||
97 => "(3485)",
|
||||
98 => "(3490)",
|
||||
99 => "(3495)",
|
||||
76 => "(3380)",
|
||||
77 => "(3385)",
|
||||
78 => "(3390)",
|
||||
79 => "(3395)",
|
||||
80 => "(3400)",
|
||||
81 => "(3405)",
|
||||
82 => "(3410)",
|
||||
83 => "(3415)",
|
||||
84 => "(3420)",
|
||||
85 => "(3425)",
|
||||
86 => "(3430)",
|
||||
87 => "(3435)",
|
||||
88 => "(3440)",
|
||||
89 => "(3445)",
|
||||
90 => "(3450)",
|
||||
91 => "(3455)",
|
||||
92 => "(3460)",
|
||||
93 => "(3465)",
|
||||
94 => "(3470)",
|
||||
95 => "(3475)",
|
||||
96 => "(3480)",
|
||||
97 => "(3485)",
|
||||
98 => "(3490)",
|
||||
99 => "(3495)",
|
||||
},
|
||||
'5500' => {
|
||||
37 => "36 (5190)",
|
||||
|
@ -95,14 +117,59 @@ sub rf_channel_map
|
|||
165 => "165 (5825)",
|
||||
},
|
||||
# 5800 UBNT US Band
|
||||
# Limiting to US speced channels until the hardware can be tested
|
||||
# lower into the spectrum.
|
||||
'5800ubntus' => {
|
||||
133 => "133 (5665)",
|
||||
134 => "134 (5670)",
|
||||
135 => "135 (5675)",
|
||||
136 => "136 (5680)",
|
||||
137 => "137 (5685)",
|
||||
138 => "138 (5690)",
|
||||
139 => "139 (5695)",
|
||||
140 => "140 (5700)",
|
||||
141 => "141 (5705)",
|
||||
142 => "142 (5710)",
|
||||
143 => "143 (5715)",
|
||||
144 => "144 (5720)",
|
||||
145 => "145 (5725)",
|
||||
146 => "146 (5730)",
|
||||
147 => "147 (5735)",
|
||||
148 => "148 (5740)",
|
||||
149 => "149 (5745)",
|
||||
150 => "150 (5750)",
|
||||
151 => "151 (5755)",
|
||||
152 => "152 (5760)",
|
||||
153 => "153 (5765)",
|
||||
154 => "154 (5770)",
|
||||
155 => "155 (5775)",
|
||||
156 => "156 (5780)",
|
||||
157 => "157 (5785)",
|
||||
158 => "158 (5790)",
|
||||
159 => "159 (5795)",
|
||||
160 => "160 (5800)",
|
||||
161 => "161 (5805)",
|
||||
162 => "162 (5810)",
|
||||
163 => "163 (5815)",
|
||||
164 => "164 (5820)",
|
||||
165 => "165 (5825)",
|
||||
166 => "166 (5830)",
|
||||
167 => "167 (5835)",
|
||||
168 => "168 (5840)",
|
||||
169 => "169 (5845)",
|
||||
170 => "170 (5850)",
|
||||
171 => "171 (5855)",
|
||||
172 => "172 (5860)",
|
||||
173 => "173 (5865)",
|
||||
174 => "174 (5870)",
|
||||
175 => "175 (5875)",
|
||||
176 => "176 (5880)",
|
||||
177 => "177 (5885)",
|
||||
178 => "178 (5890)",
|
||||
179 => "179 (5895)",
|
||||
180 => "180 (5900)",
|
||||
181 => "181 (5905)",
|
||||
182 => "182 (5910)",
|
||||
183 => "183 (5915)",
|
||||
184 => "184 (5920)",
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
#!/usr/bin/perl
|
||||
=for commnet
|
||||
|
||||
Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
|
||||
Copyright (C) 2015 Conrad Lara
|
||||
See Contributors file for additional contributors
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation version 3 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional Terms:
|
||||
|
||||
Additional use restrictions exist on the AREDN(TM) trademark and logo.
|
||||
See AREDNLicense.txt for more info.
|
||||
|
||||
Attributions to the AREDN Project must be retained in the source code.
|
||||
If importing this code into a new or existing project attribution
|
||||
to the AREDN project must be added to the source code.
|
||||
|
||||
You must not misrepresent the origin of the material conained within.
|
||||
|
||||
Modified versions must be modified to attribute to the original source
|
||||
and be marked in reasonable ways as differentiate it from the original
|
||||
version.
|
||||
|
||||
=cut
|
||||
|
||||
BEGIN {push @INC, '/www/cgi-bin'};
|
||||
use perlfunc;
|
||||
|
||||
|
||||
@files = ( "/etc/config/",
|
||||
"/etc/config.ap/",
|
||||
"/etc/config.client/",
|
||||
"/etc/config.mesh/",
|
||||
"/etc/config.mesh_ap/",
|
||||
"/etc/config.router/",
|
||||
"/etc/local/",
|
||||
"/etc/mesh-release",
|
||||
"/tmp/etc/",
|
||||
"/var/run/hosts_olsr",
|
||||
);
|
||||
|
||||
@cmds = ( "cat /proc/cpuinfo",
|
||||
"df -k",
|
||||
"ifconfig",
|
||||
"iptables -t filter -S",
|
||||
"iptables -t nat -S",
|
||||
"iptables -t mangle -S",
|
||||
"ip route list",
|
||||
"ip route list table 29",
|
||||
"ip route list table 30",
|
||||
"ip route list table 31",
|
||||
"ip route list table main",
|
||||
"ip route list table default",
|
||||
"ip rule list",
|
||||
"iwinfo",
|
||||
"iwinfo wlan0 assoclist",
|
||||
"iw phy phy0 info",
|
||||
"logread",
|
||||
"md5sum /www/cgi-bin/*",
|
||||
"opkg list-installed",
|
||||
"ps -w",
|
||||
"telnet localhost 2006",
|
||||
"/usr/local/bin/get_hardwaretype",
|
||||
"/usr/local/bin/get_boardid",
|
||||
"/usr/local/bin/get_model",
|
||||
);
|
||||
|
||||
$FREE_SPACE_TMP=get_free_space("/tmp");
|
||||
|
||||
if ($FREE_SPACE_TMP eq "N/A" || $FREE_SPACE_TMP <= 2*1024) {
|
||||
exit 1;
|
||||
}
|
||||
|
||||
system ("rm", "-r", "-f", "/tmp/sd");
|
||||
|
||||
foreach $path (@files) {
|
||||
|
||||
if ( $path =~ /^\/(.*\/).*\/$/ ) {
|
||||
my $rpath = $1;
|
||||
system("mkdir", "-p", "/tmp/sd/$rpath");
|
||||
system("cp","-r","-p","$path","/tmp/sd/$rpath");
|
||||
} else {
|
||||
$path =~ /^(.*\/).*/;
|
||||
my $sourcepath = $1;
|
||||
system("mkdir", "-p", "/tmp/sd/$sourcepath");
|
||||
system("cp","-r","-p","$path","/tmp/sd/$path");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
system("touch","/tmp/sd/data.txt");
|
||||
open (my $CMDS_OUT, '>', '/tmp/sd/data.txt') or die "Could not open dump file";
|
||||
foreach $cmd (@cmds) {
|
||||
print $CMDS_OUT "========== $cmd ==========\n";
|
||||
open(my $CMD_PIPE, "-|", $cmd ) or next;
|
||||
while (<$CMD_PIPE>) {
|
||||
print { $CMDS_OUT } $_;
|
||||
}
|
||||
}
|
||||
|
||||
close ($CMDS_OUT);
|
||||
|
||||
system("tar", "-zcf", "/tmp/supportdata.tgz", "-C", "/tmp/sd", "./");
|
||||
|
||||
open(my $SDFH, '<', "/tmp/supportdata.tgz") or exit(1);
|
||||
binmode $SDFH;
|
||||
|
||||
print "Content-type: application/x-gzip\r\n";
|
||||
print "Content-Disposition: attachment; filename=supportdata.tgz\r\n";
|
||||
print "\r\n";
|
||||
|
||||
print while <$SDFH>;
|
||||
undef ($SDFH);
|
||||
|
||||
unlink("/tmp/supportdata.tgz");
|
Loading…
Reference in New Issue