Skip to content

Commit 8e7ea34

Browse files
committed
base: fix setting timezone
1 parent 58441ae commit 8e7ea34

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
#!/usr/bin/with-contenv sh
1+
#!/usr/bin/with-contenv bash
22

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
3+
if [[ ! -z "$TZ" ]]; then
4+
if [[ -f /usr/share/zoneinfo/$TZ ]]; then
5+
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
610
fi

0 commit comments

Comments
 (0)