-
Notifications
You must be signed in to change notification settings - Fork 1
/
gen2_beta_index_ubnt.pl
executable file
·266 lines (225 loc) · 6.38 KB
/
gen2_beta_index_ubnt.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
#!/usr/bin/perl
#my $file_root="/Users/darrylquinn/Desktop/aredn/downloads/firmware/ubnt";
#my $md5cmd="md5 -r";
my $file_root="/mnt/data/www/downloads/firmware/ubnt";
my $md5cmd="md5sum";
my $download_root="http://downloads.arednmesh.org/firmware/ubnt";
print "AREDN Release Candidate Page builder...\n\n";
my %image_type = (
factory => "Loading from AirOS or TFTP",
sysupgrade => "Loading from AREDN or BBHN"
);
my @firmware = (
{
mfg => "ubnt",
mfg_name=> "Ubiquiti",
family => "bullet-m",
models => [
"AirGrid M2",
"AirGrid M5",
"Bullet M2",
"Bullet M5",
"Bullet M2 Titanium",
"Bullet M5 Titanium",
"NanoBridge M2",
"NanoBridge M5",
"NanoBridge M9",
"NanoStation Loco M2",
"NanoStation Loco M5 (XM)",
"NanoStation Loco M9",
"PicoStation M2",
],
},
{
mfg => "ubnt",
mfg_name=> "Ubiquiti",
family => "nano-m",
models => [
"NanoBridge M3",
"NanoStation M2",
"NanoStation M3",
"NanoStation M5 (XM)",
],
},
{
mfg => "ubnt",
mfg_name=> "Ubiquiti",
family => "rocket-m",
models => [
"Rocket M2",
"Rocket M3",
"Rocket M5",
"Rocket M5 GPS",
"Rocket M9",
],
},
{
mfg => "ubnt",
mfg_name=> "Ubiquiti",
family => "airrouter",
models => [
"AirRouter",
"AirRouter HP",
],
},
{
mfg => "ubnt",
mfg_name=> "Ubiquiti",
family => "nano-m-xw",
models => [
"NanoStation M5 (XW)",
],
},
{
mfg => "ubnt",
mfg_name=> "Ubiquiti",
family => "loco-m-xw",
models => [
"AirGrid M5 (XW)",
"NanoBeam NBE-M5-16",
"NanoBeam NBE-M5-19",
"NanoStation Loco M5 (XW)",
"PowerBeam PBE-M2-400",
"PowerBeam PBE-M5-300",
],
},
{
mfg => "ubnt",
mfg_name=> "Ubiquiti",
family => "rocket-m-xw",
models => [
"PowerBeam PBE-M5-400",
"Rocket M5 (XW)",
],
},
{
mfg => "cpe210",
mfg_name=> "TP-Link",
family => "220-510-520",
models => [
"CPE210",
"CPE510"
],
},
);
my @patches = (
{
name => "AREDN 3.16.1.1 OTA Fixup",
filename => "patchFixAREDN31611SysUpgrade.tgz",
desc => "Fixup for AREDN 3.16.1.1 nodes before upgrading to 3.17.1.0 to free memory and ensure a successful upgrade.",
},
);
# ==============================================================================================
$ver = shift;
die unless $ver;
my $prev_mfg;
#open(IDX, ">", "/mnt/data/www/downloads/firmware/ubnt/html/experimental2.html") or die("$!");
open(IDX, ">", "$file_root/html/releasecandidates.html") or die("$!");
print IDX << 'INDEXHTMLHEADER';
<html>
<head>
<title>AREDN™ Release Candidate Firmware</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<style>
body {
font-family: Verdana;
}
.main-section {
width: 80%;
border: solid 1px black;
}
.latest-version-section {
background-color: #e0e0e0;
}
.mfg-section {
background-color: #e0e0e0;
}
.image-section td {
border: solid 1px black;
}
.models {}
.image-size {}
.image-link-section {}
.models {}
.patches-section {}
.patch-section td {
border: solid 1px black;
}
.experimental-warning {
font-weight: bold;
color: #FF0000;
}
.message-section {
background-color: #E4CCC9;
}
#image-md5 { font-size: 8pt;}
#note {
background-color: yellow;
font-size: 8pt;
color: black;
}
</style>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-62457121-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<center>
<p>
<table class="main-section" cellpadding=5>
<tr class="experimental-warning"><td colspan="3">WARNING: Releases on this page have not undergone full testing. Releases on this page may contain bugs and or vulnerabilities and are subject to frequent revision. Production use is not supported.</td></tr>
<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
INDEXHTMLHEADER
print IDX "<tr class=\"latest-version-section\"><th colspan=3>Latest Release Candidate version is: $ver</th></tr>\n\n";
print IDX "<tr><th>STEP 1: Find your device/model from this column.</th>";
print IDX "<th colspan=2>STEP 2: Choose either the FACTORY or SYSUPGRADE file from these columns</th></tr>\n\n";
print IDX "<tr class=\"message-section\"><th> </th><th>$image_type{factory}</th><th>$image_type{sysupgrade}</th></tr>\n\n";
foreach $f (@firmware)
{
print "msg=$f->{mfg}\nmfg name=$f->{mfg_name}\nfamily=$f->{family}\n";
if ($f->{mfg} ne $prev_mfg)
{
print IDX "<tr class=\"mfg-section\"><th colspan=3>AREDN™ Firmware for $f->{mfg_name}</th></tr>\n\n";
$prev_mfg=$f->{mfg};
}
print IDX "<tr class=\"image-section\">\n";
print IDX "<td width=\"40%\" class=\"models\">";
#my @mods=@{ $f->{models} };
foreach my $model_name (@{ $f->{models}})
{
print IDX "$model_name<br />\n";
}
print IDX "</td>";
foreach $type ("factory","sysupgrade")
{
$file = "AREDN-$ver-$f->{mfg}-$f->{family}-squashfs-$type.bin";
chomp ($size = `ls -lh $file_root/$file | awk '{print \$5}'`);
chomp ($md5 = `$md5cmd $file_root/$file | awk '{print \$1}'`);
#print IDX "<td class=\"image-size\">$size</td>\n";
print IDX "<td width=\"30%\" ><a href=\"$download_root/$file\">$type</a><br>";
print IDX "<small>md5sum: $md5</small><hr />Size: $size</td>\n";
}
print IDX "</tr>\n\n";
};
# ======================= PATCHES =========================
print IDX "<tr bgcolor=\"e0e0e0\"><th colspan=3><strong>Patches</strong></th></tr>";
foreach $f (@patches)
{
chomp ($size = `ls -lh $file_root/$f->{filename} | awk '{print \$5}'`);
print IDX "<tr class=\"image-section\">\n";
print IDX "<td width=\"40%\" class=\"models\">$f->{desc}</td>";
print IDX "<td width=\"60%\" colspan=\"2\"><a href=\"http://downloads.arednmesh.org/firmware/ubnt/$f->{filename}\">$f->{name}</a><hr />Size: $size</td>";
print IDX "</tr>";
}
print IDX "</table>";
print IDX "</p>";
print IDX "</center>";
print IDX "</body>";
print IDX "</html>";
close(IDX);