diff --git a/mirror-wrapper b/mirror-wrapper index 812479e..0048d49 100755 --- a/mirror-wrapper +++ b/mirror-wrapper @@ -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 diff --git a/sbosrcarch-wrapper b/sbosrcarch-wrapper index 9f16a9d..ac0d79e 100755 --- a/sbosrcarch-wrapper +++ b/sbosrcarch-wrapper @@ -21,6 +21,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