diff options
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index c8bec4d..2841648 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -1026,6 +1026,20 @@ function system_ntp_configure() { } +function sync_system_time() { + global $config, $g; + + $syscfg = $config['system']; + + if ($g['booting']) + echo "Syncing system time before startup ..."; + + /* foreach through servers and write out to ntpd.conf */ + foreach (explode(' ', $syscfg['timeservers']) as $ts) { + mwexec("/usr/sbin/ntpdate -s $ts"); + } +} + function system_halt() { global $g; @@ -1212,4 +1226,4 @@ function enable_watchdog() { } } -?>
\ No newline at end of file +?> |