if [ ! -z $new_host_name ]; then hostname $new_host_name.${new_domain_name:-local} hostname >/etc/hostname sed -i "s/\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*$old_host_name\.$old_domain_name.*/\1 $new_host_name.${new_domain_name:-local} $new_host_name/" /etc/hosts fi