#!/usr/bin/with-contenv bash

if [ "$TZ" ]; then
    echo -e "\t\t\033[1;33m* setting timezone to $TZ\033[0m"

    [ -f "/usr/share/zoneinfo/$TZ" ] && cp "/usr/share/zoneinfo/$TZ" /etc/localtime || echo "WARNING: $TZ is not a valid time zone."
    [ -f "/usr/share/zoneinfo/$TZ" ] && echo "$TZ" >  /etc/timezone
fi
