Do not run xargs when the subscribers file is empty

Otherwise mailx will be run without any recipient addresses,
which means it prints the inbox of the current user.

Fixes: commit 234e1ec6
parent c05ba27b
......@@ -16,7 +16,7 @@ deriv="$3"
time=$(date +"%Y-%m-%d")
if [ -e "$subscribers" ] && [ -e "$error_log_to_send" ] ; then
xargs --delimiter=' ' -a "$subscribers" mailx \
xargs --no-run-if-empty --delimiter=' ' -a "$subscribers" mailx \
-a "Subject: Debian derivatives census: $deriv error.log $time" \
-a "User-Agent: Debian Derivatives Census QA bot" \
-a "Content-Type: text/plain" -- < "$error_log_to_send"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment