diff options
author | Bill Nottingham <notting@redhat.com> | 2005-09-22 18:42:26 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2005-09-22 18:42:26 +0000 |
commit | 9367a8f899e76f483fbd390b901e6bb84224952c (patch) | |
tree | db9f1f68ef329d42bac6ab6f10a767e823ea1176 /sysconfig/network-scripts | |
parent | d93f2746707ba6817b9079e5f8af829507545363 (diff) | |
download | initscripts-9367a8f899e76f483fbd390b901e6bb84224952c.tar initscripts-9367a8f899e76f483fbd390b901e6bb84224952c.tar.gz initscripts-9367a8f899e76f483fbd390b901e6bb84224952c.tar.bz2 initscripts-9367a8f899e76f483fbd390b901e6bb84224952c.tar.xz initscripts-9367a8f899e76f483fbd390b901e6bb84224952c.zip |
deal with broken networks better (#168947)
Diffstat (limited to 'sysconfig/network-scripts')
-rw-r--r-- | sysconfig/network-scripts/network-functions | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index c0e79477..49c733fc 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -220,11 +220,13 @@ set_hostname () hostname $1 if ! grep search /etc/resolv.conf >/dev/null 2>&1; then domain=`echo $1 | sed 's/^[^\.]*\.//'` - rsctmp=`mktemp /tmp/XXXXXX`; - cat /etc/resolv.conf > $rsctmp - echo "search $domain" >> $rsctmp - change_resolv_conf $rsctmp - /bin/rm -f $rsctmp + if [ -n "$domain" ]; thenb + rsctmp=`mktemp /tmp/XXXXXX`; + cat /etc/resolv.conf > $rsctmp + echo "search $domain" >> $rsctmp + change_resolv_conf $rsctmp + /bin/rm -f $rsctmp + fi fi } |