aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2022-01-09 18:42:57 -0300
committerSilvio Rhatto <rhatto@riseup.net>2022-01-09 18:42:57 -0300
commit5d51ad59b2f4c9520b98da6d2d5f4be1392d4c90 (patch)
tree93989418054070c1a3620bdca6983ad76115bdd8 /lib
parent6be074848d001aeffd5136b0983f38df7f38de71 (diff)
downloadhydra-5d51ad59b2f4c9520b98da6d2d5f4be1392d4c90.tar.gz
hydra-5d51ad59b2f4c9520b98da6d2d5f4be1392d4c90.tar.bz2
Fix: hydra_sudo_run: do not enclose the command with quotes when running as root
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/misc7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/hydra/misc b/lib/hydra/misc
index e4bbbd2..6852f27 100644
--- a/lib/hydra/misc
+++ b/lib/hydra/misc
@@ -116,7 +116,12 @@ function hydra_safe_run {
# Run a command using sudo and abort on error
function hydra_sudo_run {
- $SUDO "$@"
+ if [ -z "$SUDO" ]; then
+ $@
+ else
+ $SUDO "$@"
+ fi
+
hydra_exit_on_error "$@"
}