Commit 8e4a6e65 authored by Franco Fichtner's avatar Franco Fichtner

config: always print summary and ask for confirmation; #5

parent 08524d5e
......@@ -219,33 +219,33 @@ EOD;
if ($again) {
continue;
}
}
echo "\n" . gettext("The interfaces will be assigned as follows:") . "\n\n";
echo "\n" . gettext("The interfaces will be assigned as follows:") . "\n\n";
if ($wanif != '') {
echo "WAN -> " . $wanif . "\n";
}
if ($lanif != '') {
echo "LAN -> " . $lanif . "\n";
}
for ($i = 0; $i < count($optif); $i++) {
echo "OPT" . ($i+1) . " -> " . $optif[$i] . "\n";
}
if ($wanif != '') {
echo "WAN -> " . $wanif . "\n";
}
if ($lanif != '') {
echo "LAN -> " . $lanif . "\n";
}
for ($i = 0; $i < count($optif); $i++) {
echo "OPT" . ($i+1) . " -> " . $optif[$i] . "\n";
}
echo <<<EOD
echo <<<EOD
Do you want to proceed ${yes_no_prompt}
EOD;
if ($interactive) {
$key = chop(fgets($fp));
} else {
$key = 'y';
echo $key . PHP_EOL;
}
if ($interactive) {
$key = chop(fgets($fp));
} else {
$key = 'y';
echo $key . PHP_EOL;
}
if (in_array($key, array('y', 'Y'))) {
break;
}
if (!in_array($key, array('y', 'Y'))) {
return false;
}
if ($lanif) {
......@@ -332,6 +332,8 @@ EOD;
printf(gettext("done.%s"), "\n");
fclose($fp);
return true;
}
function autodetect_interface($ifname, $fp)
......
......@@ -150,7 +150,7 @@ if (is_interface_mismatch()) {
}
led_assigninterfaces();
set_networking_interfaces_ports();
while (!set_networking_interfaces_ports());
led_kitt();
}
......
......@@ -37,8 +37,9 @@ require_once("vpn.inc");
require_once("captiveportal.inc");
require_once("rrd.inc");
set_networking_interfaces_ports();
echo "Reloading interfaces...";
reload_interfaces_sync();
echo "done.\n";
enable_rrd_graphing();
if (set_networking_interfaces_ports()) {
echo "Reloading interfaces...";
reload_interfaces_sync();
echo "done.\n";
enable_rrd_graphing();
}
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