diff options
author | Paul Spooren <mail@aparcar.org> | 2021-06-24 07:42:53 -1000 |
---|---|---|
committer | Paul Spooren <mail@aparcar.org> | 2021-06-25 14:53:52 -1000 |
commit | 3d62b5d5c66c47814fde74a5e50d3e0f9b1d6a84 (patch) | |
tree | f0cc0ad05be091d110a0657e6d0c742a42259a41 /package/base-files/files/etc | |
parent | 3047df231743969ec2b4641d531e888b8c7f30e0 (diff) | |
download | upstream-3d62b5d5c66c47814fde74a5e50d3e0f9b1d6a84.tar.gz upstream-3d62b5d5c66c47814fde74a5e50d3e0f9b1d6a84.tar.bz2 upstream-3d62b5d5c66c47814fde74a5e50d3e0f9b1d6a84.zip |
base-files: fix /tmp/TZ when zoneinfo not installed
The zoneinfo packages are not installed per default so neither
/tmp/localtime nor /tmp/TZ is generated.
This patch mostly reverts the previous fix and instead incooperates a
solution suggested by Jo.
Fixes "base-files: fix zoneinfo support " 8af62ed
Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 56bdb6bb9781f8a0bbec5fc3075b9d2b8d12f9a8)
Diffstat (limited to 'package/base-files/files/etc')
-rwxr-xr-x | package/base-files/files/etc/init.d/system | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system index 2290964d7e..dcfc2616c6 100755 --- a/package/base-files/files/etc/init.d/system +++ b/package/base-files/files/etc/init.d/system @@ -21,13 +21,10 @@ system_config() { echo "$hostname" > /proc/sys/kernel/hostname [ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize} - rm -f /tmp/TZ - if [ -n "$zonename" ]; then - local zname=$(echo "$zonename" | tr ' ' _) - [ -f "/usr/share/zoneinfo/$zname" ] && ln -sf "/usr/share/zoneinfo/$zname" /tmp/localtime - else - echo "$timezone" > /tmp/TZ - fi + echo "$timezone" > /tmp/TZ + [ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/${zonename// /_}" ] \ + && ln -sf "/usr/share/zoneinfo/${zonename// /_}" /tmp/localtime \ + && rm -f /tmp/TZ # apply timezone to kernel hwclock -u --systz |