summaryrefslogtreecommitdiff
path: root/priv/templates
diff options
context:
space:
mode:
authorAlexey Romanov <alexey.v.romanov@gmail.com>2010-12-11 15:58:20 +0300
committerAlexey Romanov <alexey.v.romanov@gmail.com>2010-12-11 15:58:20 +0300
commit2ceeb3272139b7569c8dabc215ca1e7063b0d385 (patch)
treeed38fc14792cdc4702991d3712ed516f67b828cb /priv/templates
parentd9f0cdeddd6e7499d3901e9f10f6126d0fc1cc54 (diff)
parent90c5da80334eed4b97f475e1c0553567a9f14f0a (diff)
Merge branch 'master' of git://github.com/basho/rebar
Conflicts: priv/templates/simplenode.runner
Diffstat (limited to 'priv/templates')
-rwxr-xr-xpriv/templates/simplenode.runner17
1 files changed, 16 insertions, 1 deletions
diff --git a/priv/templates/simplenode.runner b/priv/templates/simplenode.runner
index 46141bb..cfde552 100755
--- a/priv/templates/simplenode.runner
+++ b/priv/templates/simplenode.runner
@@ -66,7 +66,22 @@ case "$1" in
stop)
# Wait for the node to completely stop...
- PID=`ps -ef|grep "$RUNNER_BASE_DIR/.*/[b]eam"|awk '{print $2}'`
+ case `uname -s` in
+ Linux|Darwin|FreeBSD|DragonFly|NetBSD|OpenBSD)
+ # PID COMMAND
+ PID=`ps ax -o pid= -o command=|\
+ grep "$RUNNER_BASE_DIR/.*/[b]eam"|cut -d' ' -f1`
+ ;;
+ SunOS)
+ # PID COMMAND
+ PID=`ps -ef -o pid= -o args=|\
+ grep "$RUNNER_BASE_DIR/.*/[b]eam"|cut -d' ' -f1`
+ ;;
+ CYGWIN*)
+ # UID PID PPID TTY STIME COMMAND
+ PID=`ps -efW|grep "$RUNNER_BASE_DIR/.*/[b]eam"|cut -d' ' -f2`
+ ;;
+ esac
$NODETOOL stop
while `kill -0 $PID 2>/dev/null`;
do