Added getting current timezone via /etc/localtime

The Current version only works on Debain based distros, I've tested my edited version on Centos 7 and Arch Linux works with no issues.
master
James Smith 2017-09-11 17:57:38 +01:00 committed by GitHub
parent 92e6c9daae
commit a1eb71ac44
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ if [ -z "$MAILCOW_HOSTNAME" ]; then
read -p "Hostname (FQDN): " -ei "mx.example.org" MAILCOW_HOSTNAME
fi
[[ -a /etc/timezone ]] && TZ=$(cat /etc/timezone)
[[ -a /etc/timezone ]] && TZ=$(cat /etc/timezone) || [[ -a /etc/localtime ]] && TZ=$(realpath /etc/localtime|sed -n 's|^.*zoneinfo/||p')
if [ -z "$TZ" ]; then
read -p "Timezone: " -ei "Europe/Berlin" TZ
else