mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-17 09:20:28 +03:00
Meta: Add exit_if_running_as_root() to shell_include.sh
This adds the method exit_if_running_as_root() which checks if the script is executed under root, and if that's the case exits the script.
This commit is contained in:
parent
f2f14ad9bd
commit
b4a0fee03d
Notes:
sideshowbarker
2024-07-17 03:18:29 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/b4a0fee03d Pull-request: https://github.com/SerenityOS/serenity/pull/18495 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/fdellwing
@ -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")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user