Project

General

Profile

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