From 784cda10ebefdbc353f0e08b1aea32e98217b3b7 Mon Sep 17 00:00:00 2001 From: paspo Date: Tue, 15 Oct 2024 09:13:10 +0200 Subject: [PATCH] run as root --- btrbk-cron | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/btrbk-cron b/btrbk-cron index 5153781..fe8d014 100755 --- a/btrbk-cron +++ b/btrbk-cron @@ -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}"