Unverified Commit 567f8915 by Rachid Koucha Committed by GitHub

/etc/resolv.conf grows indefinitely

This file grows indefinitely : upon each DHCP lease renew, the "nameserver ..dns..." line is added at the end of the file. Make a "grep" in the file to make sure that the same line does not already exist. Signed-off-by: 's avatarRachid Koucha <rachid.koucha@gmail.com>
parent 8f2cce18
...@@ -164,7 +164,10 @@ case "\$1" in ...@@ -164,7 +164,10 @@ case "\$1" in
[ -n "\$domain" ] && echo search \$domain > /etc/resolv.conf [ -n "\$domain" ] && echo search \$domain > /etc/resolv.conf
for i in \$dns ; do for i in \$dns ; do
echo nameserver \$i >> /etc/resolv.conf grep "nameserver \$i" /etc/resolv.conf > /dev/null 2>&1
if [ \$? -ne 0 ]; then
echo nameserver \$i >> /etc/resolv.conf
fi
done done
;; ;;
esac esac
......
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