mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Propagate exit status from nodetool to runner script
This commit is contained in:
parent
c63002bef8
commit
6749bb6ac0
1 changed files with 20 additions and 3 deletions
|
@ -85,6 +85,10 @@ case "$1" in
|
|||
;;
|
||||
esac
|
||||
$NODETOOL stop
|
||||
ES=$?
|
||||
if [ "$ES" -ne 0 ]; then
|
||||
exit $ES
|
||||
fi
|
||||
while `kill -0 $PID 2>/dev/null`;
|
||||
do
|
||||
sleep 1
|
||||
|
@ -94,28 +98,41 @@ case "$1" in
|
|||
restart)
|
||||
## Restart the VM without exiting the process
|
||||
$NODETOOL restart
|
||||
ES=$?
|
||||
if [ "$ES" -ne 0 ]; then
|
||||
exit $ES
|
||||
fi
|
||||
;;
|
||||
|
||||
reboot)
|
||||
## Restart the VM completely (uses heart to restart it)
|
||||
$NODETOOL reboot
|
||||
ES=$?
|
||||
if [ "$ES" -ne 0 ]; then
|
||||
exit $ES
|
||||
fi
|
||||
;;
|
||||
|
||||
ping)
|
||||
## See if the VM is alive
|
||||
$NODETOOL ping
|
||||
ES=$?
|
||||
if [ "$ES" -ne 0 ]; then
|
||||
exit $ES
|
||||
fi
|
||||
;;
|
||||
|
||||
attach)
|
||||
# Make sure a node IS running
|
||||
RES=`$NODETOOL ping`
|
||||
if [ "$RES" != "pong" ]; then
|
||||
ES=$?
|
||||
if [ "$ES" -ne 0 ]; then
|
||||
echo "Node is not running!"
|
||||
exit 1
|
||||
exit $ES
|
||||
fi
|
||||
|
||||
shift
|
||||
$ERTS_PATH/to_erl $PIPE_DIR
|
||||
exec $ERTS_PATH/to_erl $PIPE_DIR
|
||||
;;
|
||||
|
||||
console|console_clean)
|
||||
|
|
Loading…
Reference in a new issue