Commit e34cce34 authored by Franco Fichtner's avatar Franco Fichtner

rc: yes/no prompt unification

parent a8fa1a6c
......@@ -53,7 +53,7 @@ function set_networking_interfaces_ports($probe = false)
global $config;
$fp = fopen('php://stdin', 'r');
$yes_no_prompt = '[y|n]? ';
$yes_no_prompt = '[y/N]: ';
$interactive = true;
$key = null;
......@@ -95,7 +95,7 @@ EOD;
You now have the opportunity to configure VLANs. If you don't require VLANs
for initial connectivity, say no here and use the GUI to configure VLANs later.
Do you want to set up VLANs now ${yes_no_prompt}
Do you want to set up VLANs now? ${yes_no_prompt}
EOD;
if ($interactive) {
$key = chop(fgets($fp));
......@@ -277,7 +277,7 @@ EOD;
echo <<<EOD
Do you want to proceed ${yes_no_prompt}
Do you want to proceed? ${yes_no_prompt}
EOD;
if ($interactive) {
$key = chop(fgets($fp));
......@@ -454,7 +454,7 @@ function vlan_setup($iflist, $fp)
{
global $config;
$yes_no_prompt = '[y|n]? ';
$yes_no_prompt = '[y/N]: ';
if (isset($config['vlans']['vlan'])) {
......@@ -462,7 +462,7 @@ function vlan_setup($iflist, $fp)
WARNING: all existing VLANs will be cleared if you proceed!
Do you want to proceed ${yes_no_prompt}
Do you want to proceed? ${yes_no_prompt}
EOD;
if (strcasecmp(chop(fgets($fp)), "y") != 0) {
......
......@@ -27,9 +27,9 @@ set -e
echo
echo " 0) Logout 7) Ping host"
echo " 1) Assign Interfaces 8) Shell"
echo " 2) Set interface(s) IP address 9) pfTop"
echo " 3) Reset the root password 10) Filter Logs"
echo " 1) Assign interfaces 8) Shell"
echo " 2) Set interface IP address 9) pfTop"
echo " 3) Reset the root password 10) Firewall log"
echo " 4) Reset to factory defaults 11) Reload all services"
echo " 5) Power off system 12) Upgrade from console"
echo " 6) Reboot system 13) Restore a configuration"
......
......@@ -32,13 +32,13 @@ require_once("config.inc");
require_once("system.inc");
$fp = fopen('php://stdin', 'r');
$yes_no_prompt = '[y|n]? ';
$yes_no_prompt = '[y/N]: ';
echo <<<EOD
You are about to reset the firewall to factory defaults.
The firewall will reboot after resetting the configuration.
Do you want to proceed {$yes_no_prompt}
Do you want to proceed? {$yes_no_prompt}
EOD;
if (strcasecmp(chop(fgets($fp)), 'y') == 0) {
......
......@@ -34,7 +34,7 @@ require_once("system.inc");
$fp = fopen('php://stdin', 'r');
echo "The system will halt and power off. Do you want to proceed [y|n]? ";
echo 'The system will halt and power off. Do you want to proceed? [y/N]: ';
if (strcasecmp(chop(fgets($fp)), 'y') == 0) {
system_halt(true);
......
......@@ -33,7 +33,7 @@ require_once("system.inc");
$fp = fopen('php://stdin', 'r');
echo "The system will reboot. Do you want to proceed [y|n]? ";
echo 'The system will reboot. Do you want to proceed? [y/N]: ';
if (strcasecmp(chop(fgets($fp)), 'y') == 0) {
system_reboot(true);
......
......@@ -69,7 +69,7 @@ function restore_history_backup($number)
list_backups($number);
$filename = array_keys($confvers)[$number-1];
$thisbackup = $confvers[$filename];
echo 'Y/N? : ';
echo '[y/N]: ';
$confirm = strtoupper(chop(fgets($fp)));
if ($confirm == 'Y') {
$cnf = OPNsense\Core\Config::getInstance();
......
......@@ -39,9 +39,6 @@ require_once("interfaces.inc");
system_console_mute();
if (set_networking_interfaces_ports()) {
global $config;
$config = parse_config(true);
/* need to stop local dhcp servers to avoid wrong leases */
killbypid('/var/dhcpd/var/run/dhcpd.pid', 'TERM', true);
killbypid('/var/dhcpd/var/run/dhcpdv6.pid', 'TERM', true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment