Files
sxmo-utils/scripts/core/sxmo_rtcwake.sh
Willow Barraco 90f00ef11a sxmo_wakelock.sh do not auto prefix with sxmo_
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.
2023-07-15 13:22:32 +02:00

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 $*"
"$@"