summaryrefslogtreecommitdiff
path: root/setup-dns.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-05-06 09:53:36 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-05-06 09:53:36 +0000
commitec0c7a74bbf5824adc4efa54e1f91984ac870a8e (patch)
tree7f5a8763836154b10c8325629b493ebc67ead7e6 /setup-dns.in
parentf590563940559429ffe77094473d12361937852d (diff)
downloadalpine-conf-ec0c7a74bbf5824adc4efa54e1f91984ac870a8e.zip
move to .in files
Diffstat (limited to 'setup-dns.in')
-rwxr-xr-xsetup-dns.in25
1 files changed, 25 insertions, 0 deletions
diff --git a/setup-dns.in b/setup-dns.in
new file mode 100755
index 0000000..fd6b04e
--- /dev/null
+++ b/setup-dns.in
@@ -0,0 +1,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
+