From eb6a9e84c403e2e15c2edb9a87ef4916618f0d8a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 12 May 2022 12:49:52 +0200 Subject: setup-dns: don't prompt for search domain when in non-interactive mode --- setup-dns.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup-dns.in b/setup-dns.in index 84f2e96..25a2ce5 100644 --- a/setup-dns.in +++ b/setup-dns.in @@ -39,9 +39,9 @@ elif fqdn="$(get_fqdn)" && [ -n "$fqdn" ]; then domain="$fqdn" fi -if [ -n "$DOMAINNAME" ];then +if [ -n "$DOMAINNAME" ]; then domain="$DOMAINNAME" -else +elif [ $# -eq 0 ]; then ask "DNS domain name? (e.g 'bar.com')" "$domain" domain="$resp" fi @@ -53,7 +53,7 @@ else dns="$(echo $resp | tr ',' ' ')" fi -if [ "$domain" != "" ]; then +if [ -n "$domain" ]; then mkdir -p "${conf%/*}" echo "search $domain" > $conf fi -- cgit v1.2.3