Browse code

Merge "Allow a non-127.0.0.1 definition for the hostname."

Zuul authored on 2018/03/09 22:38:56
Showing 1 changed files
... ...
@@ -368,7 +368,7 @@ safe_chmod 0755 $DATA_DIR
368 368
 # Certain services such as rabbitmq require that the local hostname resolves
369 369
 # correctly.  Make sure it exists in /etc/hosts so that is always true.
370 370
 LOCAL_HOSTNAME=`hostname -s`
371
-if [ -z "`grep ^127.0.0.1 /etc/hosts | grep $LOCAL_HOSTNAME`" ]; then
371
+if ! fgrep -qwe "$LOCAL_HOSTNAME" /etc/hosts; then
372 372
     sudo sed -i "s/\(^127.0.0.1.*\)/\1 $LOCAL_HOSTNAME/" /etc/hosts
373 373
 fi
374 374