Commit 112fbba5 authored by Franco Fichtner's avatar Franco Fichtner

system: time zones are deleted from tzdata so fallback gracefully

(cherry picked from commit 015c5d00)
(cherry picked from commit a9f41407)
parent 8c0f69e7
...@@ -1394,16 +1394,15 @@ function system_timezone_configure() ...@@ -1394,16 +1394,15 @@ function system_timezone_configure()
$timezone = $syscfg['timezone']; $timezone = $syscfg['timezone'];
$timezones = get_zoneinfo(); $timezones = get_zoneinfo();
// Reset to default if empty or not existend /* reset to default if empty or nonexistent */
if (empty($timezone) || !in_array($timezone, $timezones)) { if (empty($timezone) || !in_array($timezone, $timezones) ||
!file_exists(sprintf('/usr/share/zoneinfo/%s', $timezone))) {
$timezone = 'Etc/UTC'; $timezone = 'Etc/UTC';
} }
// Apply timezone /* apply timezone */
copy(sprintf('/usr/share/zoneinfo/%s', $timezone), '/etc/localtime'); copy(sprintf('/usr/share/zoneinfo/%s', $timezone), '/etc/localtime');
mwexec("sync");
if (file_exists("/var/run/booting")) { if (file_exists("/var/run/booting")) {
echo gettext("done.") . "\n"; echo gettext("done.") . "\n";
} }
......
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