mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 17:23:08 +00:00
hardeths: only add GATEWAY in /etc/sysconfig/network if it's not already
there. Replace it otherwise.
This commit is contained in:
parent
9e161adf7c
commit
a9d48dc251
@ -73,7 +73,9 @@ else
|
||||
sed -i "s/HOSTNAME.*/HOSTNAME=`hostname`/" /etc/sysconfig/network
|
||||
fi
|
||||
if [ ! -z "$defgw" ]; then
|
||||
echo "GATEWAY=$defgw" >> /etc/sysconfig/network
|
||||
grep -qw GATEWAY /etc/sysconfig/network && \
|
||||
sed -i "s/^GATEWAY.*/GATEWAY=$defgw/" /etc/sysconfig/network || \
|
||||
echo "GATEWAY=$defgw" >> /etc/sysconfig/network
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user