nutNotifyBoot use fct - no depend on other scripts + change systemd conditions

This commit is contained in:
belgotux
2023-01-04 03:22:53 +01:00
parent 187b910577
commit 749fde13dc
4 changed files with 36 additions and 38 deletions
+4 -8
View File
@@ -27,10 +27,10 @@ server=$(echo "$1" | awk '{printf $2}' | awk -F "[@:]" '{print $2}')
powerdownflag=$(sed -ne 's#^ *POWERDOWNFLAG *\(.*\)$#\1#p' /etc/nut/upsmon.conf)
# Variables
logfile=/var/log/nutNotify.log # logfile for nutNotify
curlBin="/usr/bin/curl"
mailBin="/usr/bin/mail"
configFile=/usr/local/bin/nutNotify.conf
configFile=/usr/local/etc/nutNotify.conf
source "$configFile"
source "$(dirname $0)/nutNotifyFct.sh"
if [ ! -e "$configFile" ] ; then
echo "File $configFile doesn't exist" 1>&2
@@ -47,10 +47,6 @@ if [ ! -x $mailBin ] ; then
exit 1
fi
source "$configFile"
source "$(dirname $0)/nutNotifyFct.sh"
case "$argument" in
ONLINE)
text="UPS $ups is now online at $(date +'%H:%M:%S')"