From 8dd0ce4e0356e77b1ef6d6b0b50d5a92d1a1b0db Mon Sep 17 00:00:00 2001 From: Chris Vogel Date: Tue, 18 Jun 2024 10:53:33 +0200 Subject: [PATCH] make CI happy ...and probably some users with weird email addresses or setups --- scripts/_common.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index fa64246..9354d63 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -771,11 +771,17 @@ flohmarkt_ynh_urlwatch_cron() { --destination="/etc/cron.hourly/${flohmarkt_filename}" chown root:root "/etc/cron.hourly/${flohmarkt_filename}" chmod 755 "/etc/cron.hourly/${flohmarkt_filename}" - # run it once to initialize - sudo -u ${app} urlwatch \ - --config=/var/www/${app}/urlwatch/config.yaml \ - --urls=/var/www/${app}/urlwatch/urls.yaml \ - --cache=/var/www/${app}/urlwatch/cache.file + # run urlwatch once to initialize if cache file does not exist, + # but if sending email fails (like on CI) just warn + local urlwatch_error + if ! [[ -s /var/www/${app}/urlwatch/cache.file ]] && + ! ynh_exec_warn sudo -u ${app} urlwatch \ + --config=/var/www/${app}/urlwatch/config.yaml \ + --urls=/var/www/${app}/urlwatch/urls.yaml \ + --cache=/var/www/${app}/urlwatch/cache.file + then + ynh_print_warn --message="initial call to urlwatch failed" + fi } flohmarkt_initialized() {