summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-11-03 00:37:24 +0100
committerJakub Jirutka <jakub@jirutka.cz>2016-11-03 00:38:17 +0100
commit9c636b5276b7cf90fcdb5781a5086ffbc8d0387e (patch)
tree07c28bf3504f16174eda936a971ade769b6156f9
parent281cbbd6cd8ecfc3d5c1a365ae01f2e49ad25f24 (diff)
downloadalpine-conf-9c636b5276b7cf90fcdb5781a5086ffbc8d0387e.zip
setup-dns: fix error when resolv.conf doesn't exist and no -d given
-rw-r--r--setup-dns.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup-dns.in b/setup-dns.in
index 9b3a44f..19e7612 100644
--- a/setup-dns.in
+++ b/setup-dns.in
@@ -58,7 +58,7 @@ if [ "$domain" != "" ]; then
echo "search $domain" > $conf
fi
-if [ -n "$dns" ] || [ $# -gt 0 ]; then
+if [ -n "$dns" ] || [ $# -gt 0 ] && [ -f "$conf" ]; then
sed -i -e '/^nameserver/d' $conf
fi
for i in $dns $@; do