Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Report a helpful error if hostname -f or -d fail.

This was previously failing too early due to set -e.
  • Loading branch information...
commit 07e477e864c27b1e1512f10c5d937ba73a6a20a8 1 parent 9a49fa8
@aspiers aspiers authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 extra/install-chef-suse.sh
View
6 extra/install-chef-suse.sh
@@ -51,13 +51,11 @@ ensure_service_running () {
# It is exceedingly important that 'hostname -f' actually returns an FQDN!
# if it doesn't, add an entry to /etc/hosts, e.g.:
# 192.168.124.10 cb-admin.example.com cb-admin
-FQDN=$(hostname -f 2> /dev/null)
-if [ $? != 0 ]; then
+if ! FQDN=$(hostname -f 2>/dev/null); then
die "Unable to resolve hostname. Exiting."
fi
-DOMAIN=$(hostname -d 2> /dev/null)
-if [ $? != 0 ]; then
+if ! DOMAIN=$(hostname -d 2>/dev/null); then
die "Unable to resolve domain name. Exiting."
fi
Please sign in to comment.
Something went wrong with that request. Please try again.