Skip to content

Commit 789f1ee

Browse files
authored
Merge pull request #23 from ten0s/master
Support empty cookie
2 parents 227098d + 652d89c commit 789f1ee

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ then you can copy the entop script to a bin directory
2020
## Usage
2121
To run entop make sure you have Erlang installed, cecho and entop libraries installed, and that the script is in your path.
2222

23-
Usage: ./entop <TARGETNODE> <COOKIE>
23+
Usage: ./entop <TARGETNODE> [<COOKIE>]
2424

2525
### An example of how you run entop:
2626

entop

+3-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@
2626
##==============================================================================
2727

2828
## Shell script for running entop. See the function usage() for instructions.
29-
TARGETNODE=
30-
COOKIE=
3129

3230
function usage() {
33-
echo -e "Usage: ./entop <TARGETNODE> <COOKIE>"
31+
echo -e "Usage: ./entop <TARGETNODE> [<COOKIE>]"
3432
}
3533

3634
if [[ $# -lt 1 ]]; then
@@ -41,7 +39,7 @@ fi
4139
TARGETNODE=$1
4240
shift
4341

44-
COOKIE=$1
42+
COOKIE=${1-undefined}
4543
shift
4644

4745
if [[ -d _build ]] ; then
@@ -51,7 +49,7 @@ else
5149
fi
5250

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

5654
CODE=$?
5755
if [[ $CODE -eq 101 ]]; then

0 commit comments

Comments
 (0)