diff options
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifup-post | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post index 8110d324..838eb620 100755 --- a/sysconfig/network-scripts/ifup-post +++ b/sysconfig/network-scripts/ifup-post @@ -34,9 +34,9 @@ if [ "$DEVICETYPE" = ppp -a "$PEERDNS" != no -a -n "$DNS1" ] && # and do not know if sed is capable of this... current_replacement="$DNS1" next_replacement="$DNS2" - cat /etc/resolv.conf | while read answer ; do + (cat /etc/resolv.conf ; echo EOF ; echo EOF) | while read answer ; do case $answer in - nameserver*) + nameserver*|EOF) if [ -n "$current_replacement" ] ; then echo "nameserver $current_replacement" >> $tr if [ -n "$next_replacement" ] ; then @@ -46,7 +46,9 @@ if [ "$DEVICETYPE" = ppp -a "$PEERDNS" != no -a -n "$DNS1" ] && current_replacement= fi else - echo "$answer" >> $tr + if [ $answer != EOF ] ; then + echo "$answer" >> $tr + fi fi ;; *) |