27871c0dc3
Instead of a single url this patch allows to have a list of urls. So in case of network instability a router can still reach local mesh-cloud server to pull a update from. In this stage the autoupdater simply tries every mirror until one passes all tests.
49 lines
774 B
Perl
49 lines
774 B
Perl
my $cfg = $CONFIG->{autoupdater};
|
|
|
|
print <<'END';
|
|
#/bin/sh
|
|
|
|
uci -q get autoupdater.settings || {
|
|
uci -q batch <<EOF
|
|
set autoupdater.settings=autoupdater
|
|
END
|
|
|
|
for (qw(enabled branch)) {
|
|
print "set autoupdater.settings.$_=$cfg->{$_}\n";
|
|
}
|
|
|
|
print <<'END';
|
|
EOF
|
|
}
|
|
|
|
uci -q batch <<EOF
|
|
END
|
|
|
|
foreach my $name (sort keys $cfg->{branches}) {
|
|
my $branch = $cfg->{branches}->{$name};
|
|
|
|
print <<END;
|
|
|
|
delete autoupdater.$name
|
|
set autoupdater.$name=branch
|
|
END
|
|
|
|
for (qw(probability good_signatures)) {
|
|
print "set autoupdater.$name.$_=$branch->{$_}\n";
|
|
}
|
|
|
|
for (@{$branch->{mirrors}}) {
|
|
print "add_list autoupdater.$name.mirror=$_\n";
|
|
}
|
|
|
|
for (@{$branch->{pubkeys}}) {
|
|
print "add_list autoupdater.$name.pubkey=$_\n";
|
|
}
|
|
}
|
|
|
|
print <<END;
|
|
|
|
commit autoupdater
|
|
EOF
|
|
END
|