nutNotifyShutdown use fct and update readme
This commit is contained in:
+6
-14
@@ -2,23 +2,15 @@
|
||||
# Auteur : Belgotux
|
||||
# Site : www.monlinux.net
|
||||
# Licence : GPLV3
|
||||
# Version : 1.0
|
||||
# Version : 1.1
|
||||
# Date : 08/04/2012
|
||||
# Update : 04/01/2023
|
||||
|
||||
# Variables
|
||||
logfile=/var/log/nutNotify/nutNotify.log #logfile for nutNotify
|
||||
flagfile=/var/log/nutNotify/nutShutdown.flag
|
||||
# variables
|
||||
configFile=/usr/local/etc/nutNotify.conf
|
||||
|
||||
#add to log
|
||||
function addLog {
|
||||
if [ "$logfile" == "" ] ; then
|
||||
echo "Can't write to log !" 1>&2
|
||||
return 1
|
||||
else
|
||||
echo "$(date +'%a %d %H:%M:%S') $1" >> $logfile
|
||||
return $?
|
||||
fi
|
||||
}
|
||||
source "$configFile"
|
||||
source "$(dirname $0)/nutNotifyFct.sh"
|
||||
|
||||
|
||||
addLog "poweroff $HOSTNAME"
|
||||
|
||||
Reference in New Issue
Block a user