2022-02-06 12:42:08 +00:00
|
|
|
#!/bin/bash
|
2022-02-06 12:39:52 +00:00
|
|
|
|
|
|
|
if [[ -z "$1" ]]
|
|
|
|
then
|
|
|
|
echo "Usage: $0 <timer>"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! [[ -f "/var/lib/systemd-timer-monitored/$1" ]]
|
|
|
|
then
|
|
|
|
echo "No status file found"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
|
|
|
|
exitcode="$(cat "/var/lib/systemd-timer-monitored/$1")"
|
|
|
|
|
|
|
|
echo "Last timer run exited $exitcode"
|
|
|
|
|
|
|
|
if [[ $exitcode -ne 0 ]]
|
|
|
|
then
|
|
|
|
exit 2
|
|
|
|
else
|
|
|
|
exit 0
|
|
|
|
fi
|