]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: hydra_sudo_run: do not enclose the command with quotes when running as root
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Jan 2022 21:42:57 +0000 (18:42 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Jan 2022 21:42:57 +0000 (18:42 -0300)
lib/hydra/misc

index e4bbbd2ac1a8a8e058ac9976bd5f876308de8129..6852f2777f452a365b59801665ade3a0e5cd2067 100644 (file)
@@ -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 "$@"
 }