1
|
#!/usr/local/bin/php-cgi -f
|
2
|
<?php
|
3
|
/*
|
4
|
* rc.initial.defaults
|
5
|
*
|
6
|
* part of pfSense (https://www.pfsense.org)
|
7
|
* Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
|
8
|
* All rights reserved.
|
9
|
*
|
10
|
* originally part of m0n0wall (http://m0n0.ch/wall)
|
11
|
* Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
12
|
* All rights reserved.
|
13
|
*
|
14
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
15
|
* you may not use this file except in compliance with the License.
|
16
|
* You may obtain a copy of the License at
|
17
|
*
|
18
|
* http://www.apache.org/licenses/LICENSE-2.0
|
19
|
*
|
20
|
* Unless required by applicable law or agreed to in writing, software
|
21
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
22
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
23
|
* See the License for the specific language governing permissions and
|
24
|
* limitations under the License.
|
25
|
*/
|
26
|
|
27
|
/* parse the configuration and include all functions used below */
|
28
|
require_once("util.inc");
|
29
|
require_once("config.lib.inc");
|
30
|
require_once("functions.inc");
|
31
|
|
32
|
$fp = fopen('php://stdin', 'r');
|
33
|
|
34
|
echo "\n" . gettext("You are about to reset the firewall to factory defaults.");
|
35
|
echo "\n" . gettext("The firewall will reboot after resetting the configuration.");
|
36
|
echo "\n" . gettext("All additional packages installed will be removed.");
|
37
|
echo "\n" . gettext("Do you want to proceed [y|n]?") . " ";
|
38
|
|
39
|
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
|
40
|
reset_factory_defaults();
|
41
|
echo "\n" . sprintf(gettext("%s is rebooting now."), $g['product_name']) . "\n";
|
42
|
system_reboot_sync();
|
43
|
}
|
44
|
|
45
|
fclose($fp);
|
46
|
?>
|