diff --git a/Meta/shell_include.sh b/Meta/shell_include.sh index 0d95a6b880e..78aa59e9e59 100644 --- a/Meta/shell_include.sh +++ b/Meta/shell_include.sh @@ -17,6 +17,12 @@ die() { exit 1 } +exit_if_running_as_root() { + if [ "$(id -u)" -eq 0 ]; then + die "$*" + fi +} + find_executable() { paths=("/usr/sbin" "/sbin")