Skip to content

Commit

Permalink
Merge pull request #23 from ten0s/master
Browse files Browse the repository at this point in the history
Support empty cookie
  • Loading branch information
djnym authored May 29, 2019
2 parents 227098d + 652d89c commit 789f1ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ then you can copy the entop script to a bin directory
## Usage
To run entop make sure you have Erlang installed, cecho and entop libraries installed, and that the script is in your path.

Usage: ./entop <TARGETNODE> <COOKIE>
Usage: ./entop <TARGETNODE> [<COOKIE>]

### An example of how you run entop:

Expand Down
8 changes: 3 additions & 5 deletions entop
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@
##==============================================================================

## Shell script for running entop. See the function usage() for instructions.
TARGETNODE=
COOKIE=

function usage() {
echo -e "Usage: ./entop <TARGETNODE> <COOKIE>"
echo -e "Usage: ./entop <TARGETNODE> [<COOKIE>]"
}

if [[ $# -lt 1 ]]; then
Expand All @@ -41,7 +39,7 @@ fi
TARGETNODE=$1
shift

COOKIE=$1
COOKIE=${1-undefined}
shift

if [[ -d _build ]] ; then
Expand All @@ -51,7 +49,7 @@ else
fi

erl -noinput -hidden $PATHS +A 20 +Bc \
-eval "entop:main(['${TARGETNODE}','${COOKIE}'])" $@
-eval "entop:main(['${TARGETNODE}','${COOKIE}'])." "$@"

CODE=$?
if [[ $CODE -eq 101 ]]; then
Expand Down

0 comments on commit 789f1ee

Please sign in to comment.