
It is inconsistent with the debug outputs, and is confusing for the user. sxmo_wakelock.sh should be a tool to manage every lock, not only the sxmo ones. Instead we should prefix manually from our scripts.
23 lines
468 B
Bash
Executable File
23 lines
468 B
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
# Copyright 2022 Sxmo Contributors
|
|
|
|
# shellcheck source=configs/profile.d/sxmo_init.sh
|
|
. /etc/profile.d/sxmo_init.sh
|
|
|
|
. sxmo_common.sh
|
|
|
|
# We can have multiple cronjobs at the same time
|
|
sxmo_wakelock.sh lock sxmo_executing_cronjob_$$ infinite
|
|
sxmo_wakelock.sh unlock sxmo_waiting_cronjob
|
|
|
|
finish() {
|
|
sxmo_wakelock.sh unlock sxmo_executing_cronjob_$$
|
|
exit 0
|
|
}
|
|
|
|
trap 'finish' TERM INT EXIT
|
|
|
|
sxmo_log "Running $*"
|
|
"$@"
|