diff options
Diffstat (limited to 'sysconfig')
-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 } |