aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2015-04-09 16:09:37 +0200
committerLukas Nykryn <lnykryn@redhat.com>2015-04-09 18:43:04 +0200
commitecc64049caf281e5f18fd6996f3716c83aacdad3 (patch)
tree9a30a67d8d71fe4ece230abf0c1c100ce57f13f9 /sysconfig
parentba31851ef681ad261d0a2e5ad6a2ac4fc7ce2788 (diff)
downloadinitscripts-ecc64049caf281e5f18fd6996f3716c83aacdad3.tar
initscripts-ecc64049caf281e5f18fd6996f3716c83aacdad3.tar.gz
initscripts-ecc64049caf281e5f18fd6996f3716c83aacdad3.tar.bz2
initscripts-ecc64049caf281e5f18fd6996f3716c83aacdad3.tar.xz
initscripts-ecc64049caf281e5f18fd6996f3716c83aacdad3.zip
network-functions: fix change_resolv_conf after grep update
Diffstat (limited to 'sysconfig')
-rw-r--r--sysconfig/network-scripts/network-functions8
1 files changed, 4 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 85a8880b..bcf75cd2 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -515,10 +515,10 @@ is_bonding_device ()
change_resolv_conf ()
{
s=$(/bin/grep '^[\ \ ]*option' /etc/resolv.conf 2>/dev/null);
- if [ "x$s" != "x" ]; then
- s="$s"$'\n';
- fi;
if [ $# -gt 1 ]; then
+ if [ "x$s" != "x" ]; then
+ s="$s"$'\n';
+ fi;
n_args=$#;
while [ $n_args -gt 0 ];
do
@@ -536,7 +536,7 @@ change_resolv_conf ()
done;
elif [ $# -eq 1 ]; then
if [ "x$s" != "x" ]; then
- s="$s"$(/bin/grep -vF "$s" $1);
+ s="$s"$'\n'$(/bin/grep -vF "$s" $1);
else
s=$(cat $1);
fi;