Commit 9c636b52 authored by Jakub Jirutka's avatar Jakub Jirutka

setup-dns: fix error when resolv.conf doesn't exist and no -d given

parent 281cbbd6
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment