# HG changeset patch # User Franz Glasner # Date 1677334658 -3600 # Node ID d2796c709dcfc343af0976c11595f5319d517857 # Parent 357887df56f5145bbb3ca31623165b430fa5280b Make the list of existing trigger files available to conditions and actions diff -r 357887df56f5 -r d2796c709dcf etc/periodic/daily/720.local-triggered-action --- a/etc/periodic/daily/720.local-triggered-action Sat Feb 25 13:09:53 2023 +0100 +++ b/etc/periodic/daily/720.local-triggered-action Sat Feb 25 15:17:38 2023 +0100 @@ -113,16 +113,12 @@ echo "Testing for newly triggered action${profilestr}" _do_action="" - _remove_files="" + TRIGGER_FILES="" for _f in ${daily_local_triggered_action_files}; do if [ -r "${_f}" ]; then _do_action="yes" - case "${daily_local_triggered_action_files_remove}" in - [Yy][Ee][Ss]) - _remove_files="${_remove_files} ${_f}" - ;; - esac + TRIGGER_FILES="${TRIGGER_FILES} ${_f}" fi done @@ -152,12 +148,14 @@ # Remove trigger files if configured to do so if [ ${rc} -eq 0 ]; then - if [ -n "${_remove_files}" ]; then - echo "Removing trigger files${profilestr} ..." - for _rf in ${_remove_files}; do - rm -fv "${_rf}" - done - fi + case "${daily_local_triggered_action_files_remove}" in + [Yy][Ee][Ss]) + echo "Removing trigger files${profilestr} ..." + for _rf in ${TRIGGER_FILES}; do + rm -fv "${_rf}" + done + ;; + esac fi else echo "No action triggers found${profilestr}"