diff --git a/app/views/foreman/job_templates/resolve_traces.erb b/app/views/foreman/job_templates/resolve_traces.erb index 0fb8911001a..ba2316aa01d 100644 --- a/app/views/foreman/job_templates/resolve_traces.erb +++ b/app/views/foreman/job_templates/resolve_traces.erb @@ -20,5 +20,9 @@ reboot = commands.delete('reboot') shutdown -r +1 <% else -%> <%= commands.join("\n") %> -sudo katello-tracer-upload +RUN_TRACER_CMD='katello-tracer-upload' +if [ "$(id -u)" -ne 0 ]; then + RUN_TRACER_CMD='sudo katello-tracer-upload' +fi +$RUN_TRACER_CMD <% end %>