We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58441ae commit 8e7ea34Copy full SHA for 8e7ea34
base/rootfs/etc/cont-init.d/01-set-timezone
@@ -1,6 +1,10 @@
1
-#!/usr/bin/with-contenv sh
+#!/usr/bin/with-contenv bash
2
3
-if [ $TZ ]; then
4
- [ -f /usr/share/zoneinfo/$TZ ] && cp /usr/share/zoneinfo/$TZ /etc/localtime || echo "WARNING: $TZ is not a valid time zone."
5
- [ -f /usr/share/zoneinfo/$TZ ] && echo "$TZ" > /etc/timezone
+if [[ ! -z "$TZ" ]]; then
+ if [[ -f /usr/share/zoneinfo/$TZ ]]; then
+ ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
6
+ echo "$TZ" > /etc/timezone
7
+ else
8
+ echo "WARNING: $TZ is not a valid time zone."
9
+ fi
10
fi
0 commit comments