mirror of
https://github.com/mag37/dockcheck.git
synced 2026-04-19 02:47:45 +00:00
Added releasenotes-logic to all templates, fix to DSM+smtp
This commit is contained in:
@@ -9,17 +9,17 @@
|
|||||||
MSMTP=$(which msmtp)
|
MSMTP=$(which msmtp)
|
||||||
SSMTP=$(which ssmtp)
|
SSMTP=$(which ssmtp)
|
||||||
|
|
||||||
if [ -n $MSMPT ] ; then
|
if [ -n "$MSMPT" ] ; then
|
||||||
MAIL=$MSMTP
|
MailPkg=$MSMTP
|
||||||
elif [ -n $SSMTP ] && [ -z $MAIL ] ; then
|
elif [ -n "$SSMTP" ] ; then
|
||||||
MAIL=$SSMTP
|
MailPkg=$SSMTP
|
||||||
else
|
else
|
||||||
echo "No msmtp or ssmtp binary found in PATH: $PATH" ; exit 1
|
echo "No msmtp or ssmtp binary found in PATH: $PATH" ; exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
send_notification() {
|
send_notification() {
|
||||||
Updates=("$@")
|
Updates=("$@")
|
||||||
UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
||||||
FromHost=$(hostname)
|
FromHost=$(hostname)
|
||||||
CfgFile="/usr/syno/etc/synosmtp.conf"
|
CfgFile="/usr/syno/etc/synosmtp.conf"
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ SenderMail=${SenderMail:-$(grep 'eventmail1' $CfgFile | sed -n 's/.*"\([^"]*\)".
|
|||||||
|
|
||||||
printf "\nSending email notification.\n"
|
printf "\nSending email notification.\n"
|
||||||
|
|
||||||
$MAIL $SendMailTo << __EOF
|
$MailPkg $SendMailTo << __EOF
|
||||||
From: "$SenderName" <$SenderMail>
|
From: "$SenderName" <$SenderMail>
|
||||||
date:$(date -R)
|
date:$(date -R)
|
||||||
To: <$SendMailTo>
|
To: <$SendMailTo>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
send_notification() {
|
send_notification() {
|
||||||
Updates=("$@")
|
Updates=("$@")
|
||||||
UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
||||||
FromHost=$(hostname)
|
FromHost=$(hostname)
|
||||||
|
|
||||||
printf "\nSending Apprise notification\n"
|
printf "\nSending Apprise notification\n"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
send_notification() {
|
send_notification() {
|
||||||
Updates=("$@")
|
Updates=("$@")
|
||||||
UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
||||||
FromHost=$(hostname)
|
FromHost=$(hostname)
|
||||||
|
|
||||||
# platform specific notification code would go here
|
# platform specific notification code would go here
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
send_notification() {
|
send_notification() {
|
||||||
Updates=("$@")
|
Updates=("$@")
|
||||||
UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
||||||
FromHost=$(hostname)
|
FromHost=$(hostname)
|
||||||
|
|
||||||
# platform specific notification code would go here
|
# platform specific notification code would go here
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
send_notification() {
|
send_notification() {
|
||||||
Updates=("$@")
|
Updates=("$@")
|
||||||
UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
||||||
FromHost=$(hostname)
|
FromHost=$(hostname)
|
||||||
|
|
||||||
printf "\nSending ntfy.sh notification\n"
|
printf "\nSending ntfy.sh notification\n"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
send_notification() {
|
send_notification() {
|
||||||
Updates=("$@")
|
Updates=("$@")
|
||||||
UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
||||||
FromHost=$(hostname)
|
FromHost=$(hostname)
|
||||||
|
|
||||||
# platform specific notification code would go here
|
# platform specific notification code would go here
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
send_notification() {
|
send_notification() {
|
||||||
Updates=("$@")
|
Updates=("$@")
|
||||||
UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
||||||
FromHost=$(hostname)
|
FromHost=$(hostname)
|
||||||
|
|
||||||
# platform specific notification code would go here
|
# platform specific notification code would go here
|
||||||
|
|||||||
@@ -8,17 +8,17 @@
|
|||||||
MSMTP=$(which msmtp)
|
MSMTP=$(which msmtp)
|
||||||
SSMTP=$(which ssmtp)
|
SSMTP=$(which ssmtp)
|
||||||
|
|
||||||
if [ -n $MSMPT ] ; then
|
if [ -n "$MSMPT" ] ; then
|
||||||
MAIL=$MSMTP
|
MailPkg=$MSMTP
|
||||||
elif [ -n $SSMTP ] && [ -z $MAIL ] ; then
|
elif [ -n "$SSMTP" ] ; then
|
||||||
MAIL=$SSMTP
|
MailPkg=$SSMTP
|
||||||
else
|
else
|
||||||
echo "No msmtp or ssmtp binary found in PATH: $PATH" ; exit 1
|
echo "No msmtp or ssmtp binary found in PATH: $PATH" ; exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
send_notification() {
|
send_notification() {
|
||||||
Updates=("$@")
|
Updates=("$@")
|
||||||
UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
||||||
FromHost=$(hostname)
|
FromHost=$(hostname)
|
||||||
|
|
||||||
# User variables:
|
# User variables:
|
||||||
@@ -28,7 +28,7 @@ SubjectTag="dockcheck"
|
|||||||
|
|
||||||
printf "\nSending email notification.\n"
|
printf "\nSending email notification.\n"
|
||||||
|
|
||||||
$MAIL $SendMailTo << __EOF
|
$MailPkg $SendMailTo << __EOF
|
||||||
From: "$FromHost" <$SendMailFrom>
|
From: "$FromHost" <$SendMailFrom>
|
||||||
date:$(date -R)
|
date:$(date -R)
|
||||||
To: <$SendMailTo>
|
To: <$SendMailTo>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
send_notification() {
|
send_notification() {
|
||||||
Updates=("$@")
|
Updates=("$@")
|
||||||
UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
[ -s "$ScriptWorkDir"/urls.list ] && UpdToString=$( releasenotes ) || UpdToString=$( printf "%s\n" "${Updates[@]}" )
|
||||||
FromHost=$(hostname)
|
FromHost=$(hostname)
|
||||||
|
|
||||||
# platform specific notification code would go here
|
# platform specific notification code would go here
|
||||||
|
|||||||
Reference in New Issue
Block a user