浏览代码

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.
James Smith 8 年之前
父节点
当前提交
a1eb71ac44
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      generate_config.sh

+ 1 - 1
generate_config.sh

@@ -16,7 +16,7 @@ if [ -z "$MAILCOW_HOSTNAME" ]; then
   read -p "Hostname (FQDN): " -ei "mx.example.org" MAILCOW_HOSTNAME
   read -p "Hostname (FQDN): " -ei "mx.example.org" MAILCOW_HOSTNAME
 fi
 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
 if [ -z "$TZ" ]; then
   read -p "Timezone: " -ei "Europe/Berlin" TZ
   read -p "Timezone: " -ei "Europe/Berlin" TZ
 else
 else