mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00: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
1 changed files with 6 additions and 0 deletions
|
@ -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 a new issue