Reset sxmo_run_periodically.sh wait first feature
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
if [ "$1" = "-" ]; then
|
||||
waitfirst=1
|
||||
shift
|
||||
fi
|
||||
|
||||
timeout="$1"
|
||||
shift
|
||||
|
||||
@@ -13,6 +18,13 @@ finish() {
|
||||
|
||||
trap 'finish' TERM INT
|
||||
|
||||
if [ -n "$waitfirst" ]; then
|
||||
sleep "$timeout" &
|
||||
SLEEPPID="$!"
|
||||
wait "$SLEEPPID"
|
||||
unset SLEEPPID
|
||||
fi
|
||||
|
||||
while : ; do
|
||||
"$@" &
|
||||
CMDPID="$!"
|
||||
|
Reference in New Issue
Block a user