Check for sudo

This commit is contained in:
Andreas Zweili 2024-04-17 20:05:26 +02:00
parent 68bb79a2b6
commit 5a95b915f7
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,11 @@ let
${
inputs.attic.packages.${system}.attic-server
}/bin/atticd --config ${config.services.atticd.configFile} --mode garbage-collector-once
# Fail if $SUDO_USER is empty.
if [ -z "$SUDO_USER" ]; then
printf "This script must be run with sudo.\n"
exit 1
fi
'';
in
{