aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates/extended_bin.dtl
diff options
context:
space:
mode:
authorJordan Wilberding <[email protected]>2014-05-14 21:02:14 +0200
committerJordan Wilberding <[email protected]>2014-05-14 21:02:14 +0200
commit227b1ec27d9b4c186366a64f81628843c8a8cc3e (patch)
tree3b1417ffe454e252ead4810d0eb595ad16c17259 /priv/templates/extended_bin.dtl
parent84b176094d06ff22b3c495fa90976e9aaa4a04f2 (diff)
parent074edc6eb5746d42ef04dedb83028a85894883f7 (diff)
downloadrelx-227b1ec27d9b4c186366a64f81628843c8a8cc3e.tar.gz
relx-227b1ec27d9b4c186366a64f81628843c8a8cc3e.tar.bz2
relx-227b1ec27d9b4c186366a64f81628843c8a8cc3e.zip
Merge pull request #179 from tsloughter/remote_console
append '@hostname' if missing from sname, for remsh
Diffstat (limited to 'priv/templates/extended_bin.dtl')
-rw-r--r--priv/templates/extended_bin.dtl15
1 files changed, 14 insertions, 1 deletions
diff --git a/priv/templates/extended_bin.dtl b/priv/templates/extended_bin.dtl
index 0dcdd18..0b6c763 100644
--- a/priv/templates/extended_bin.dtl
+++ b/priv/templates/extended_bin.dtl
@@ -30,7 +30,7 @@ relx_rem_sh() {
# Generate a unique id used to allow multiple remsh to the same node
# transparently
id="remsh$(relx_gen_id)-${NAME}"
-
+
# Setup remote shell command to control node
exec "$BINDIR/erl" "$NAME_TYPE" "$id" -remsh "$NAME" -boot start_clean \
-setcookie "$COOKIE"
@@ -97,6 +97,19 @@ fi
NAME_TYPE="$(echo "$NAME_ARG" | awk '{print $1}')"
NAME="$(echo "$NAME_ARG" | awk '{print $2}')"
+# User can specify an sname without @hostname
+# This will fail when creating remote shell
+# So here we check for @ and add @hostname if missing
+case $NAME in
+ *@*)
+ # Nothing to do
+ ;;
+ *)
+ # Add @hostname
+ NAME=$NAME@`hostname`
+ ;;
+esac
+
# Extract the target cookie
COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH")"
if [ -z "$COOKIE_ARG" ]; then