Browse Source

Don't ask for mailcow hostname and time zone if already exported within the shell

Tudor Georgescu 8 years ago
parent
commit
a62fdd4ee5
1 changed files with 7 additions and 2 deletions
  1. 7 2
      generate_config.sh

+ 7 - 2
generate_config.sh

@@ -12,8 +12,13 @@ if [[ -f mailcow.conf ]]; then
   esac
 fi
 
-read -p "Hostname (FQDN): " -ei "mx.example.org" MAILCOW_HOSTNAME
-read -p "Timezone: " -ei "Europe/Berlin" TZ
+if [ -z "$MAILCOW_HOSTNAME" ]; then
+  read -p "Hostname (FQDN): " -ei "mx.example.org" MAILCOW_HOSTNAME
+fi
+
+if [ -z "$TZ" ]; then
+  read -p "Timezone: " -ei "Europe/Berlin" TZ
+fi
 
 cat << EOF > mailcow.conf
 # ------------------------------