summaryrefslogtreecommitdiff
path: root/setup-dns.in
blob: 02d6cc0a9821349fbc34981569a40aed4a77fee2 (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
26
27
#!/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"

if [ "$domain" != "" ]; then
	echo "search $domain" > $conf
fi
for i in $dns ; do
	echo "nameserver $i" >> $conf
done