diff options
Diffstat (limited to 'usr/local/www/diag_backup.php')
-rwxr-xr-x | usr/local/www/diag_backup.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php index a880a13..b3389b3 100755 --- a/usr/local/www/diag_backup.php +++ b/usr/local/www/diag_backup.php @@ -186,9 +186,18 @@ if ($_POST) { $data = ""; if($options == "nopackages") { + if(!$_POST['backuparea']) { + /* backup entire configuration */ + $data = file_get_contents("{$g['conf_path']}/config.xml"); + } else { + /* backup specific area of configuration */ + $data = backup_config_section($_POST['backuparea']); + $name = "{$_POST['backuparea']}-{$name}"; + } $sfn = "{$g['tmp_path']}/config.xml.nopkg"; - exec("sed '/<installedpackages>/,/<\/installedpackages>/d' /conf/config.xml > {$sfn}"); - $data = file_get_contents($sfn); + file_put_contents($sfn, $data); + exec("sed '/<installedpackages>/,/<\/installedpackages>/d' {$sfn} > {$sfn}-new"); + $data = file_get_contents($sfn . "-new"); } else { if(!$_POST['backuparea']) { /* backup entire configuration */ |