summaryrefslogtreecommitdiff
path: root/setup-dns.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-12 12:49:52 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-12 12:49:52 +0200
commiteb6a9e84c403e2e15c2edb9a87ef4916618f0d8a (patch)
treeb57051e0616f7435067bb6c5de9ca1857f67fe12 /setup-dns.in
parentcbc9404c7ac55824e30ad73737aeb18b2c2d44fb (diff)
downloadalpine-conf-eb6a9e84c403e2e15c2edb9a87ef4916618f0d8a.zip
setup-dns: don't prompt for search domain when in non-interactive mode
Diffstat (limited to 'setup-dns.in')
-rw-r--r--setup-dns.in6
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