summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/common.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/common.sh b/lib/common.sh
index 6305528..b1e7d6e 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -85,8 +85,9 @@ trap_abort() {
}
trap_exit() {
+ local r=$?
trap - EXIT INT QUIT TERM HUP
- cleanup
+ cleanup $r
}
die() {
@@ -266,7 +267,6 @@ check_root() {
if type -P sudo >/dev/null; then
exec sudo -- "$@"
else
- exec su root -c "$(printf '%q' "$@")"
+ exec su root -c "$(printf ' %q' "$@")"
fi
- die 'This script must be run as root.'
}