mirror of https://github.com/aredn/aredn.git
Merge branch 'FixSYSUPGRADEBackups' into release-3.15.1.0
ref AREDN->ticket:131
This commit is contained in:
commit
87f655f103
|
@ -0,0 +1,32 @@
|
|||
# This file contains a list of files to retain over a sysupgrade with "Keep Settings" in the GUI.
|
||||
# This list will be used instead of the list normally used by sysupgrade.
|
||||
/etc/config/
|
||||
/etc/config.ap/_setup
|
||||
/etc/config.ap/_setup.dhcp
|
||||
/etc/config.ap/_setup.ports
|
||||
/etc/config.client/_setup
|
||||
/etc/config.client/_setup.dhcp
|
||||
/etc/config.client/_setup.ports
|
||||
/etc/config.mesh_ap/_setup
|
||||
/etc/config.mesh_ap/_setup.dhcp
|
||||
/etc/config.mesh_ap/_setup.ports
|
||||
/etc/config.mesh/_setup
|
||||
/etc/config.mesh/_setup.dhcp.dmz
|
||||
/etc/config.mesh/_setup.dhcp.nat
|
||||
/etc/config.mesh/_setup.ports.dmz
|
||||
/etc/config.mesh/_setup.ports.nat
|
||||
/etc/config.mesh/_setup.services.dmz
|
||||
/etc/config.mesh/_setup.services.nat
|
||||
/etc/config.router/_setup
|
||||
/etc/config.router/_setup.dhcp
|
||||
/etc/config.router/_setup.ports
|
||||
/etc/dropbear/dropbear_dss_host_key
|
||||
/etc/dropbear/dropbear_rsa_host_key
|
||||
/etc/firewall.user
|
||||
/etc/group
|
||||
/etc/hosts
|
||||
/etc/httpd.conf
|
||||
/etc/local/services
|
||||
/etc/local/uci/hsmmmesh
|
||||
/etc/passwd
|
||||
/etc/shadow
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
IFS="
|
||||
"
|
||||
|
||||
addedpaths="/cgi-bin/vpn
|
||||
/cgi-bin/vpnc
|
||||
/cgi-bin/supporttool
|
||||
"
|
||||
|
||||
currentpwd=$(grep "/cgi-bin/setup" /etc/httpd.conf |cut -d ':' -f 3)
|
||||
|
||||
for protectedpath in $addedpaths
|
||||
do
|
||||
if grep -q "$protectedpath" "/etc/httpd.conf"; then
|
||||
continue
|
||||
fi
|
||||
echo "$protectedpath:root:$currentpwd" >> /etc/httpd.conf
|
||||
done
|
||||
|
|
@ -228,6 +228,33 @@ if($fw_install and -f "$tmpdir/firmware")
|
|||
{
|
||||
if ( $parms{checkbox_keep_settings} )
|
||||
{
|
||||
open (my $SYSUPGRADECONF, "/etc/arednsysupgrade.conf") or die "Failed to open arednsysupgrade.conf";
|
||||
open (my $TMPSYSUPGRADECONF, '>', "/tmp/sysupgradefilelist") or die "Failed to open TMPSYSUPGRADECONF";
|
||||
while (<$SYSUPGRADECONF>){
|
||||
chomp;
|
||||
next if /^\#/ ;
|
||||
if ( -e "$_" ) {
|
||||
print $TMPSYSUPGRADECONF "$_\n";
|
||||
}
|
||||
}
|
||||
close $SYSUPGRADECONF;
|
||||
close $TMPSYSUPGRADECONF;
|
||||
|
||||
system("tar -czf /tmp/arednsysupgradebackup.tgz -T /tmp/sysupgradefilelist");
|
||||
if ($? == 1) {
|
||||
print "
|
||||
<center><h2>ERROR: Could not backup filesystem.</h2>
|
||||
<h3>An error occured trying to backup the file system
|
||||
</center>
|
||||
";
|
||||
page_footer();
|
||||
print "</body></html>";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
system("rm -f /tmp/sysupgradefilelist");
|
||||
|
||||
|
||||
nvram_set("nodeupgraded","1");
|
||||
print "
|
||||
<center><h2>Firmware will be written in the background.</h2>
|
||||
|
@ -240,7 +267,7 @@ When the Status 4 LED is solid on you can get your new DHCP lease and reconnect
|
|||
(This page will automatically reload in 2½ minutes)</h3>
|
||||
</center></body></html>
|
||||
";
|
||||
open(FILE, "/sbin/sysupgrade -q $tmpdir/firmware 2>&1 |") or die;
|
||||
open(FILE, "/sbin/sysupgrade -f /tmp/arednsysupgradebackup.tgz -q $tmpdir/firmware 2>&1 |") or die;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue