mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Remove all additional packages from the system before reset to factory default. Fixes #5829
This commit is contained in:
parent
aecade14d0
commit
7222324e2a
@ -624,6 +624,10 @@ function write_config($desc="Unknown", $backup = true, $write_config_only = fals
|
||||
function reset_factory_defaults($lock = false, $reboot_required = true) {
|
||||
global $g;
|
||||
|
||||
/* Remove all additional packages */
|
||||
|
||||
mwexec("/bin/sh /usr/local/sbin/{$g['product_name']}-upgrade -r ALL_PACKAGES");
|
||||
|
||||
conf_mount_rw();
|
||||
if (!$lock) {
|
||||
$lockkey = lock('config', LOCK_EX);
|
||||
|
||||
@ -2090,6 +2090,7 @@ function system_check_reset_button() {
|
||||
|
||||
***********************************************************************
|
||||
* Reset button pressed - resetting configuration to factory defaults. *
|
||||
* All additional packages installed will be removed *
|
||||
* The system will reboot after this completes. *
|
||||
***********************************************************************
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
|
||||
echo "\n" . gettext("You are about to reset the firewall to factory defaults.");
|
||||
echo "\n" . gettext("The firewall will reboot after resetting the configuration.");
|
||||
echo "\n" . gettext("All additional packages installed will be removed.");
|
||||
echo "\n" . gettext("Do you want to proceed [y|n]?") . " ";
|
||||
|
||||
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user