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 16:09:37 +0200
commitbe5e6338fa2c46429d9516659d33273de56a06ef (patch)
treec1550e078a2025e3a104005feb6c270c6bf00274 /sysconfig
parent55a50ebc591ebd0f4cfbb8ecc204fa20ee6a7368 (diff)
downloadinitscripts-be5e6338fa2c46429d9516659d33273de56a06ef.tar
initscripts-be5e6338fa2c46429d9516659d33273de56a06ef.tar.gz
initscripts-be5e6338fa2c46429d9516659d33273de56a06ef.tar.bz2
initscripts-be5e6338fa2c46429d9516659d33273de56a06ef.tar.xz
initscripts-be5e6338fa2c46429d9516659d33273de56a06ef.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 9a5e359c..3afa9122 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -542,10 +542,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
@@ -563,7 +563,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;