Skip to content

Commit

Permalink
Merge pull request #809 from Olivier-Boudeville/flexible_release_cookie
Browse files Browse the repository at this point in the history
Flexible release cookie
  • Loading branch information
tsloughter authored Aug 22, 2020
2 parents 6bdb834 + 476fdc9 commit 2033aaa
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions priv/templates/extended_bin
Original file line number Diff line number Diff line change
Expand Up @@ -647,17 +647,21 @@ fi

# Extract the target cookie
# Do this before relx_get_nodename so we can use it and not create a ~/.erlang.cookie
COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)"
DEFAULT_COOKIE_FILE="$HOME/.erlang.cookie"
if [ -z "$COOKIE_ARG" ]; then
if [ -f "$DEFAULT_COOKIE_FILE" ]; then
COOKIE="$(cat "$DEFAULT_COOKIE_FILE")"
if [ -n "$RELX_COOKIE" ]; then
COOKIE="$RELX_COOKIE"
else
COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)"
DEFAULT_COOKIE_FILE="$HOME/.erlang.cookie"
if [ -z "$COOKIE_ARG" ]; then
if [ -f "$DEFAULT_COOKIE_FILE" ]; then
COOKIE="$(cat "$DEFAULT_COOKIE_FILE")"
else
echo "No cookie is set or found. This limits the scripts functionality, installing, upgrading, rpc and getting a list of versions will not work."
fi
else
echo "No cookie is set or found. This limits the scripts functionality, installing, upgrading, rpc and getting a list of versions will not work."
# Extract cookie name from COOKIE_ARG
COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')"
fi
else
# Extract cookie name from COOKIE_ARG
COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')"
fi

# User can specify an sname without @hostname
Expand Down

0 comments on commit 2033aaa

Please sign in to comment.