diff options
-rw-r--r-- | etc/inc/system.inc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 405785d..035c5de 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -1273,7 +1273,17 @@ function system_timezone_configure() { /* extract appropriate timezone file */ $timezone = $syscfg['timezone']; - if (!$timezone) + if ($timezone) { + exec('/usr/bin/tar -tvzf /usr/share/zoneinfo.tgz', $tzs); + foreach ($tzs as $tz) { + if (preg_match(",{$timezone}$,", $tz)) + break; + if (preg_match(",{$timezone} link to *(.*)$,", $tz, $matches)) { + $timezone = $matches[1]; + break; + } + } + } else $timezone = "Etc/UTC"; conf_mount_rw(); |