Skip to content

Commit

Permalink
Kill all children on failure ;->
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Dec 29, 2011
1 parent e14db0c commit d7929a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/bitpocket
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function sync {
function on_slow_sync_start {
if [ -n "$SLOW_SYNC_START_CMD" ]; then
rm -rf "$SLOW_SYNC_FILE"
(sleep $SLOW_SYNC_TIME && touch "$SLOW_SYNC_FILE" && eval "$SLOW_SYNC_START_CMD") &
(sleep $SLOW_SYNC_TIME && touch "$SLOW_SYNC_FILE" && eval "$SLOW_SYNC_START_CMD" ; wait) &
disown
shell_pid=$!
fi
Expand Down Expand Up @@ -134,6 +134,7 @@ function die {
cleanup

if [ -n "$shell_pid" ]; then
pkill -P $shell_pid &>/dev/null
kill $shell_pid &>/dev/null
fi

Expand Down

0 comments on commit d7929a7

Please sign in to comment.