diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-12 12:49:52 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-12 12:49:52 +0200 |
commit | eb6a9e84c403e2e15c2edb9a87ef4916618f0d8a (patch) | |
tree | b57051e0616f7435067bb6c5de9ca1857f67fe12 | |
parent | cbc9404c7ac55824e30ad73737aeb18b2c2d44fb (diff) | |
download | alpine-conf-eb6a9e84c403e2e15c2edb9a87ef4916618f0d8a.zip |
setup-dns: don't prompt for search domain when in non-interactive mode
-rw-r--r-- | setup-dns.in | 6 |
1 files 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 |