From 993ddd94e152c6fa02230bf858c0ade129a0f664 Mon Sep 17 00:00:00 2001 From: belgotux Date: Thu, 5 Jan 2023 01:38:44 +0100 Subject: [PATCH] fix boot service with sleep for curl --- nutNotifyBoot.sh | 6 +++--- systemd-notify | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nutNotifyBoot.sh b/nutNotifyBoot.sh index 4196b14..1b57f6c 100644 --- a/nutNotifyBoot.sh +++ b/nutNotifyBoot.sh @@ -45,11 +45,11 @@ text="$(date '+%d/%m/%y %H:%M:%S') $HOSTNAME booting\n Downtime $(date -d @$(( $ if [ -e $flagfile ] ; then case "$notifynut_method" in mail) - sendMail "$subjectMail" "$text" ;; + sendMail "$subjectMail" "$text" ;; pushbullet) - sendPushBullet "$pushbulletSubject" "$text" ;; + sleep 30; sendPushBullet "$pushbulletSubject" "$text" ;; telegram) - sendTelegram "$text" "$telegramSubject" ;; + sleep30; sendTelegram "$text" "$telegramSubject" ;; esac rm $flagfile fi diff --git a/systemd-notify b/systemd-notify index 6313de9..9806768 100644 --- a/systemd-notify +++ b/systemd-notify @@ -1,6 +1,6 @@ [Unit] Description=send mail at boot after a power loss -After=network.target postfix.service +After=network.target network-online.target nss-lookup.target postfix.service ConditionPathExists=/usr/local/etc/nutNotify.conf ConditionFileIsExecutable=/usr/local/bin/nutNotifyBoot.sh ConditionPathIsDirectory=/var/log/nutNotify