From a186b30e8f984c7cfed2f9e5ec75fa6aedfdeeed Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Sun, 11 Aug 2019 02:24:28 -0400 Subject: [PATCH] Add -t flag to timeout calls --- psu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/psu b/psu index ea68cb4..35c72d1 100644 --- a/psu +++ b/psu @@ -227,7 +227,7 @@ main() { # Tasks should not have one of these states: # 'failed', 'orphaned', 'remove' - timeout -t $TIMEOUT bash -c "until (export PORTAINER_SERVICE_NAME=$PORTAINER_SERVICE_NAME && export DEBUG_MODE=false && export VERBOSE_MODE=false && psu -a tasks:healthy -q) >/dev/null 2>&1; do echo -n \$(if [ \"\$VERBOSE_MODE\" == \"true\" ]; then echo -n .; fi) && sleep 1; done;" + timeout $TIMEOUT bash -c "until (export PORTAINER_SERVICE_NAME=$PORTAINER_SERVICE_NAME && export DEBUG_MODE=false && export VERBOSE_MODE=false && psu -a tasks:healthy -q) >/dev/null 2>&1; do echo -n \$(if [ \"\$VERBOSE_MODE\" == \"true\" ]; then echo -n .; fi) && sleep 1; done;" status=$? if $(exit $status); then @@ -251,7 +251,7 @@ main() { else echo_verbose "List $scope tasks of stack '$PORTAINER_STACK_NAME'..." local services - services="$(timeout -t $TIMEOUT bash -c "until (export DEBUG_MODE=false && export VERBOSE_MODE=false && echo \"\$(psu -a services -q)\"); do sleep 1; done;")" + services="$(timeout $TIMEOUT bash -c "until (export DEBUG_MODE=false && export VERBOSE_MODE=false && echo \"\$(psu -a services -q)\"); do sleep 1; done;")" # TODO: Improve performance, find a way to do parallel requests for service in $services; do export PORTAINER_SERVICE_NAME=${service#"${PORTAINER_STACK_NAME}_"}