mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +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:
committed by
Andrew Kaster
parent
f2f14ad9bd
commit
b4a0fee03d
@@ -17,6 +17,12 @@ die() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exit_if_running_as_root() {
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
die "$*"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
find_executable() {
|
find_executable() {
|
||||||
paths=("/usr/sbin" "/sbin")
|
paths=("/usr/sbin" "/sbin")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user