aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2015-01-16 14:44:30 +0100
committerLukas Nykryn <lnykryn@redhat.com>2015-01-16 14:44:30 +0100
commitda08727f3bbcc419096b160968aee83104bb7cf6 (patch)
tree45d6702db3a41f2a979f0d96f3ca9ed4d086baf7
parenta9c3e6924fc8b39ee6c7a7ba93bc392d1bc40a95 (diff)
downloadinitscripts-da08727f3bbcc419096b160968aee83104bb7cf6.tar
initscripts-da08727f3bbcc419096b160968aee83104bb7cf6.tar.gz
initscripts-da08727f3bbcc419096b160968aee83104bb7cf6.tar.bz2
initscripts-da08727f3bbcc419096b160968aee83104bb7cf6.tar.xz
initscripts-da08727f3bbcc419096b160968aee83104bb7cf6.zip
ifup-post: check resolve.conf also with DNS2
-rwxr-xr-xsysconfig/network-scripts/ifup-post9
1 files changed, 8 insertions, 1 deletions
diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post
index 2e93e008..46f49e3a 100755
--- a/sysconfig/network-scripts/ifup-post
+++ b/sysconfig/network-scripts/ifup-post
@@ -26,7 +26,14 @@ fi
if [ "$PEERDNS" != "no" ] ||[ -n "$RESOLV_MODS" -a "$RESOLV_MODS" != "no" ]; then
[ -n "$MS_DNS1" ] && DNS1=$MS_DNS1
[ -n "$MS_DNS2" ] && DNS2=$MS_DNS2
- if [ -n "$DNS1" ] && ! grep -q "^nameserver $DNS1" /etc/resolv.conf &&
+
+ if [ -z "$DNS1" -a -n "$DNS2" ]; then
+ DNS1=$DNS2
+ DNS2=
+ fi
+
+ if ( [ -n "$DNS1" ] && ! grep -q "^nameserver $DNS1" /etc/resolv.conf ) ||
+ ( [ -n "$DNS2" ] && ! grep -q "^nameserver $DNS2" /etc/resolv.conf ) &&
tr=$(mktemp /tmp/XXXXXX) ; then
current_replacement="$DNS1"
next_replacement="$DNS2"