Skip to content

Commit

Permalink
Merge pull request #459 from djnym/erlang_hostname
Browse files Browse the repository at this point in the history
get nodename from erlang, not hostname
  • Loading branch information
tsloughter committed Mar 31, 2016
2 parents 175a55b + dc3dbf8 commit 1e15397
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions priv/templates/extended_bin
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ relx_get_pid() {
fi
}

relx_get_longname() {
relx_get_nodename() {
id="longname$(relx_gen_id)-${NAME}"
"$BINDIR/erl" -boot start_clean -eval 'io:format("~s~n", [node()]), halt()' -noshell -name $id | sed -e 's/.*@//g'
"$BINDIR/erl" -boot start_clean -eval '[Host] = tl(string:tokens(atom_to_list(node()),"@")), io:format("~s~n", [Host]), halt()' -noshell ${NAME_TYPE} $id
}

# Connect to a remote node
Expand Down Expand Up @@ -189,15 +189,7 @@ case $NAME in
# Nothing to do
;;
*)
# Add @hostname
case $NAME_TYPE in
-sname)
NAME=$NAME@`hostname -s`
;;
-name)
NAME=$NAME@$(relx_get_longname)
;;
esac
NAME=$NAME@$(relx_get_nodename)
;;
esac

Expand Down

0 comments on commit 1e15397

Please sign in to comment.