mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Simplify logic to remove packages section from backup
This commit is contained in:
parent
9887b24ed8
commit
25e8ca83d1
@ -179,10 +179,7 @@ if ($_POST) {
|
||||
$data = backup_config_section($_POST['backuparea']);
|
||||
$name = "{$_POST['backuparea']}-{$name}";
|
||||
}
|
||||
$sfn = "{$g['tmp_path']}/config.xml.nopkg";
|
||||
file_put_contents($sfn, $data);
|
||||
exec("sed '/<installedpackages>/,/<\/installedpackages>/d' {$sfn} > {$sfn}-new");
|
||||
$data = file_get_contents($sfn . "-new");
|
||||
$data = preg_replace('/\t*<installedpackages>.*<\/installedpackages>\n/sm', '', $data);
|
||||
} else {
|
||||
if (!$_POST['backuparea']) {
|
||||
/* backup entire configuration */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user