Don't run the *-wrapper scripts as root.

This commit is contained in:
Darren 'Tadgy' Austin 2026-05-22 13:41:48 +01:00
commit 862d73b03a
2 changed files with 12 additions and 0 deletions

View file

@ -22,6 +22,12 @@ notify() {
return 0
}
# Don't run as root!
(( $(id -u) == 0 )) && {
printf "%s: %s\\n" "${0##*/}" "don't run me as root - it messes up permissions!" >&2
exit 1
}
# Only allow one copy of the script to run at any time.
# shellcheck disable=SC2154
if [[ "$FLOCK" != "$0" ]]; then