Skip to content

Commit

Permalink
Detect host name more correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Sep 24, 2014
1 parent 3981e09 commit 4deba29
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ setup_configuration_directory() {
if [ ! -e $DROONGA_BASE_DIR/catalog.json -o \
! -e $DROONGA_BASE_DIR/$NAME.yaml ]; then
[ "$HOST" = "Auto Detect" ] &&
determine_hostname &&
HOST=$DETERMINED_HOSTNAME
HOST=$(determine_hostname)

if [ "$HOST" = "" ]; then
HOST=$(hostname)
Expand Down Expand Up @@ -116,7 +115,7 @@ guess_global_hostname() {
determine_hostname() {
global_hostname=$(guess_global_hostname)
if [ "$global_hostname" != "" ]; then
DETERMINED_HOSTNAME="$global_hostname"
echo "$global_hostname"
return 0
fi

Expand All @@ -126,11 +125,11 @@ determine_hostname() {
-e "s/^ +| +\$//g" |\
cut -d " " -f 1)
if [ "$address" != "" ]; then
DETERMINED_HOSTNAME="$address"
echo "$address"
return 0
fi

DETERMINED_HOSTNAME=""
echo ""
return 1
}

Expand Down

0 comments on commit 4deba29

Please sign in to comment.