run as root

This commit is contained in:
Paolo Asperti 2024-10-15 09:13:10 +02:00
parent 2adcac027b
commit 784cda10eb
Signed by: paspo
GPG Key ID: 06D46905D19D5182

View File

@ -5,6 +5,12 @@ LOCKFILE=/run/btrbk/btrbk.lock
LOGFILE=$(mktemp)
trap 'rm -f -- "${LOGFILE}"' EXIT
# check for superpowers
if [[ "${EUID}" -ne 0 ]] ; then
echo "Please run me as root"
exit 1
fi
echo "---" | tee -a "${LOGFILE}"
echo "Start btrbk-cron: $(date||true)" | tee -a "${LOGFILE}"