mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:47:45 +00:00
Meta: Do not ignore error message with exec
When calling sub-programs from shell with exec, the useful || die idiom does not actually do anything, since the first script is gone.
This commit is contained in:
parent
8e935ad3b1
commit
319cdf4ff3
1 changed files with 2 additions and 1 deletions
|
@ -8,7 +8,8 @@ die() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$(id -u)" != 0 ]; then
|
if [ "$(id -u)" != 0 ]; then
|
||||||
exec sudo -E -- "$0" "$@" || die "this script needs to run as root"
|
sudo -E -- "$0" "$@" || die "this script needs to run as root"
|
||||||
|
exit 0
|
||||||
else
|
else
|
||||||
: "${SUDO_UID:=0}" "${SUDO_GID:=0}"
|
: "${SUDO_UID:=0}" "${SUDO_GID:=0}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue