docker-images/pluie/alpine/install.d/30-tz.sh

19 lines
535 B
Bash
Raw Normal View History

2016-08-04 01:00:33 +00:00
#!/bin/bash
2016-08-06 00:29:06 +00:00
# @app pluie/alpine
# @author a-Sansara https://git.pluie.org/pluie/docker-images
2016-08-04 01:00:33 +00:00
if [ ! -z "$TZ" ] && [ -f "/usr/share/zoneinfo/$TZ" ]; then
echo "$TZ" > /etc/TZ
cp "/usr/share/zoneinfo/$TZ" "/etc/localtime"
if [ ! "${TZ///*/}" = "$TZ" ]; then
mkdir -p "/usr/share/zoneinfo/${TZ///*/}"
fi
cp /etc/localtime "/usr/share/zoneinfo/$TZ"
echo -e "\033[1;38;5;203mTIMEZONE : $TZ"
date
echo -en "\033[m"
apk del tzdata
2016-08-04 01:00:33 +00:00
else
echo -e "\033[1;38;5;203mNO DEFINED TIMEZONE"
fi