diff options
author | Michael K. Johnson <johnsonm@redhat.com> | 1999-10-27 17:14:56 +0000 |
---|---|---|
committer | Michael K. Johnson <johnsonm@redhat.com> | 1999-10-27 17:14:56 +0000 |
commit | a3777b9989230dbf525df0e32659bef22813f469 (patch) | |
tree | a189c59deee4d28bf3bc9a3c8d4ebd01c04e815d /sysconfig | |
parent | 8c210e5b2bb2de110d4cebfc5f428e9d6f1af67b (diff) | |
download | initscripts-a3777b9989230dbf525df0e32659bef22813f469.tar initscripts-a3777b9989230dbf525df0e32659bef22813f469.tar.gz initscripts-a3777b9989230dbf525df0e32659bef22813f469.tar.bz2 initscripts-a3777b9989230dbf525df0e32659bef22813f469.tar.xz initscripts-a3777b9989230dbf525df0e32659bef22813f469.zip |
add new nameserver entries as well as replacing nameserver entries
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 ;; *) |