Commit 1a7199cc authored by Ad Schellevis's avatar Ad Schellevis

code style rc.bootup

parent 5fa09cd4
......@@ -43,34 +43,26 @@ function is_install_media()
unlink($file);
return false;
}
return true;
}
function is_interface_mismatch()
{
global $config;
$do_assign = false;
$i = 0;
if (isset($config['interfaces'])) {
foreach (legacy_config_get_interfaces(array("virtual" => false)) as $ifname => $ifcfg) {
if (preg_match("/^enc|^cua|^tun|^tap|^l2tp|^pptp|^ppp|^ovpn|^gif|^gre|^lagg|^bridge|vlan|_wlan/i", $ifcfg['if'])) {
/* Do not check these interfaces */
$i++;
continue;
} elseif (does_interface_exist($ifcfg['if']) == false) {
$do_assign = true;
} else {
$i++;
return true;
}
}
}
return $do_assign;
return false;
}
function rescue_detect_keypress()
{
$timer = 7;
......@@ -83,8 +75,11 @@ function rescue_detect_keypress()
$key = null;
while (!isset($key) || !in_array($key, array('c', 'C', 'r', 'R', 'i', 'I'))) {
if ($timer >= 9) { echo chr(8) . chr(8) . ($timer==9 ? chr(32) : null) . "{$timer}"; }
else { echo chr(8). "{$timer}"; }
if ($timer >= 9) {
echo chr(8) . chr(8) . ($timer==9 ? chr(32) : null) . "{$timer}";
} else {
echo chr(8). "{$timer}";
}
shell_exec('/bin/stty -icanon min 0 time 25');
$key = shell_exec('/bin/dd count=1 status=none');
shell_exec('/bin/stty icanon');
......
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