Improve compatibility by replacing use of seq with a native for-loop

Closes gh-21068
This commit is contained in:
Andy Wilkinson 2020-04-29 19:30:35 +01:00
parent 76d71e58d7
commit c7a5b72565
1 changed files with 2 additions and 2 deletions

View File

@ -223,7 +223,7 @@ stop() {
do_stop() {
kill "$1" &> /dev/null || { echoRed "Unable to kill process $1"; return 1; }
for i in $(seq 1 $STOP_WAIT_TIME); do
for ((i = 1; i <= STOP_WAIT_TIME; i++)); do
isRunning "$1" || { echoGreen "Stopped [$1]"; rm -f "$2"; return 0; }
[[ $i -eq STOP_WAIT_TIME/2 ]] && kill "$1" &> /dev/null
sleep 1
@ -241,7 +241,7 @@ force_stop() {
do_force_stop() {
kill -9 "$1" &> /dev/null || { echoRed "Unable to kill process $1"; return 1; }
for i in $(seq 1 $STOP_WAIT_TIME); do
for ((i = 1; i <= STOP_WAIT_TIME; i++)); do
isRunning "$1" || { echoGreen "Stopped [$1]"; rm -f "$2"; return 0; }
[[ $i -eq STOP_WAIT_TIME/2 ]] && kill -9 "$1" &> /dev/null
sleep 1