mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
26 lines
426 B
Bash
Executable File
26 lines
426 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
echo "Starting crond..."
|
|
|
|
crond_pid=""
|
|
|
|
cleanup() {
|
|
status=$?
|
|
echo "Crond stopped! (exit ${status})"
|
|
}
|
|
|
|
forward_signal() {
|
|
if [[ -n "${crond_pid}" ]]; then
|
|
kill -TERM "${crond_pid}" 2>/dev/null || true
|
|
fi
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
trap forward_signal INT TERM
|
|
|
|
/usr/sbin/crond -c "${SYSTEM_SERVICES_CROND}" -f -L "${LOG_CROND}" >> "${LOG_CROND}" 2>&1 &
|
|
crond_pid=$!
|
|
|
|
wait "${crond_pid}"
|
|
exit $? |