mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +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
|
||||
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
|
||||
: "${SUDO_UID:=0}" "${SUDO_GID:=0}"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue