Skip to content

Instantly share code, notes, and snippets.

@neheb
Created February 17, 2021 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neheb/7356492f2733272d6b837ddcd5bcc097 to your computer and use it in GitHub Desktop.
Save neheb/7356492f2733272d6b837ddcd5bcc097 to your computer and use it in GitHub Desktop.
--- a/package/base-files/files/etc/init.d/system
+++ b/package/base-files/files/etc/init.d/system
@@ -22,9 +22,11 @@ system_config() {
echo "$hostname" > /proc/sys/kernel/hostname
[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
- echo "$timezone" > /tmp/TZ
- [ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && \
- ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ
+ if [ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ]; then
+ ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime
+ else
+ echo "$timezone" > /tmp/localtime
+ fi
# apply timezone to kernel
hwclock -u --systz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment