Revision 285ef132
Added by Ermal Luçi over 10 years ago
etc/inc/system.inc | ||
---|---|---|
184 | 184 |
fwrite($fd, $resolvconf); |
185 | 185 |
fclose($fd); |
186 | 186 |
|
187 |
if (!$g['booting']) {
|
|
187 |
if (!platform_booting()) {
|
|
188 | 188 |
/* restart dhcpd (nameservers may have changed) */ |
189 | 189 |
if (!$dynupdate) |
190 | 190 |
services_dhcpd_configure(); |
... | ... | |
714 | 714 |
|
715 | 715 |
$syslogcfg = $config['syslog']; |
716 | 716 |
|
717 |
if ($g['booting'])
|
|
717 |
if (platform_booting())
|
|
718 | 718 |
echo gettext("Starting syslog..."); |
719 | 719 |
|
720 | 720 |
if (is_process_running("fifolog_writer")) |
... | ... | |
894 | 894 |
else |
895 | 895 |
$retval = mwexec_bg("/usr/sbin/syslogd -s -c -c -l {$g['dhcpd_chroot_path']}/var/run/log -P {$g['varrun_path']}/syslog.pid {$syslogd_extra}"); |
896 | 896 |
|
897 |
if ($g['booting'])
|
|
897 |
if (platform_booting())
|
|
898 | 898 |
echo gettext("done.") . "\n"; |
899 | 899 |
|
900 | 900 |
return $retval; |
... | ... | |
941 | 941 |
function system_webgui_start() { |
942 | 942 |
global $config, $g; |
943 | 943 |
|
944 |
if ($g['booting'])
|
|
944 |
if (platform_booting())
|
|
945 | 945 |
echo gettext("Starting webConfigurator..."); |
946 | 946 |
|
947 | 947 |
chdir($g['www_path']); |
... | ... | |
984 | 984 |
/* attempt to start lighthttpd */ |
985 | 985 |
$res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-webConfigurator.conf"); |
986 | 986 |
|
987 |
if ($g['booting']) {
|
|
987 |
if (platform_booting()) {
|
|
988 | 988 |
if ($res == 0) |
989 | 989 |
echo gettext("done.") . "\n"; |
990 | 990 |
else |
... | ... | |
1379 | 1379 |
|
1380 | 1380 |
$syscfg = $config['system']; |
1381 | 1381 |
|
1382 |
if ($g['booting'])
|
|
1382 |
if (platform_booting())
|
|
1383 | 1383 |
echo gettext("Setting timezone..."); |
1384 | 1384 |
|
1385 | 1385 |
/* extract appropriate timezone file */ |
... | ... | |
1405 | 1405 |
mwexec("sync"); |
1406 | 1406 |
conf_mount_ro(); |
1407 | 1407 |
|
1408 |
if ($g['booting'])
|
|
1408 |
if (platform_booting())
|
|
1409 | 1409 |
echo gettext("done.") . "\n"; |
1410 | 1410 |
} |
1411 | 1411 |
|
... | ... | |
1760 | 1760 |
function sync_system_time() { |
1761 | 1761 |
global $config, $g; |
1762 | 1762 |
|
1763 |
if ($g['booting'])
|
|
1763 |
if (platform_booting())
|
|
1764 | 1764 |
echo gettext("Syncing system time before startup..."); |
1765 | 1765 |
|
1766 | 1766 |
/* foreach through servers and write out to ntpd.conf */ |
... | ... | |
1768 | 1768 |
mwexec("/usr/local/sbin/ntpdate -s $ts"); |
1769 | 1769 |
} |
1770 | 1770 |
|
1771 |
if ($g['booting'])
|
|
1771 |
if (platform_booting())
|
|
1772 | 1772 |
echo gettext("done.") . "\n"; |
1773 | 1773 |
|
1774 | 1774 |
} |
... | ... | |
1896 | 1896 |
} |
1897 | 1897 |
|
1898 | 1898 |
if (isset($config['system']['harddiskstandby'])) { |
1899 |
if ($g['booting']) {
|
|
1899 |
if (platform_booting()) {
|
|
1900 | 1900 |
echo gettext('Setting hard disk standby... '); |
1901 | 1901 |
} |
1902 | 1902 |
|
... | ... | |
1908 | 1908 |
if (set_single_sysctl('hw.ata.standby', (int)$standby)) { |
1909 | 1909 |
// Reinitialize ATA-drives |
1910 | 1910 |
mwexec('/usr/local/sbin/atareinit'); |
1911 |
if ($g['booting']) {
|
|
1911 |
if (platform_booting()) {
|
|
1912 | 1912 |
echo gettext("done.") . "\n"; |
1913 | 1913 |
} |
1914 |
} else if ($g['booting']) {
|
|
1914 |
} else if (platform_booting()) {
|
|
1915 | 1915 |
echo gettext("failed!") . "\n"; |
1916 | 1916 |
} |
1917 |
} else if ($g['booting']) {
|
|
1917 |
} else if (platform_booting()) {
|
|
1918 | 1918 |
echo gettext("failed!") . "\n"; |
1919 | 1919 |
} |
1920 | 1920 |
} |
Also available in: Unified diff
Rather than set the g['booting'] on globals provide a function to test for that doing the right checks