aboutsummaryrefslogtreecommitdiffstats
path: root/setup-dns.in
blob: fd6b04ef36aac085e7c7cb55019acf6c8eacdfa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

PREFIX=
. "$PREFIX/lib/libalpine.sh"

conf="$ROOT/etc/resolv.conf"
if [ -f "$conf" ] ; then
	domain=`awk '/^domain/ {print $2}' $conf`
	dns=`awk '/^nameserver/ {print $2}' $conf`
fi

echon "DNS domain name? (e.g 'bar.com') [$domain] "
default_read domain $domain
echon "DNS nameserver(s)? ["
for i in $dns ; do
	echon "$i "
done
echon "] "
default_read dns "$dns"

echo "search $domain" > $conf
for i in $dns ; do
	echo "nameserver $i" >> $conf
done