glob="$c[0-9]*"
arr=($glob); file="${arr[0]}"; [[ $glob != "$file" ]] || file=
-u=${USER:-root}
[[ -d $cbase ]] || mkdir -p $cbase
if [[ ! $file ]]; then
fi
if $send_mail; then
journalctl -u $service.service --after-cursor=$(<$file) | \
- mail -s "$HOSTNAME: $service exit code: $code" $u@localhost
+ mail -s "$HOSTNAME: $service exit code: $code" root
fi
else
if [[ $file ]]; then
rm -f $file
if [[ $file == $c$errors ]]; then
- echo | mail -s "$HOSTNAME: $service success" $u@localhost
+ echo | mail -s "$HOSTNAME: $service success" root
fi
fi
fi