aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2016-03-31 17:48:45 -0500
committerTristan Sloughter <[email protected]>2016-03-31 17:48:45 -0500
commit1e15397a4924804f248facc18ccd07076baef7a4 (patch)
tree264680858b8ba649bc7ce19ab0cdae1b8de908d0
parent175a55b82fad566616f2dc3d3f6b9ee04bf38a5a (diff)
parentdc3dbf8d539189a9714e88f80048f0c7d8cf6287 (diff)
downloadrelx-1e15397a4924804f248facc18ccd07076baef7a4.tar.gz
relx-1e15397a4924804f248facc18ccd07076baef7a4.tar.bz2
relx-1e15397a4924804f248facc18ccd07076baef7a4.zip
Merge pull request #459 from djnym/erlang_hostnamev3.19.0
get nodename from erlang, not hostname
-rwxr-xr-xpriv/templates/extended_bin14
1 files changed, 3 insertions, 11 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index d7a9a0b..8c523d9 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -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
@@ -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