Przeglądaj źródła

check that token and email are present

Daniel Gibbs 10 lat temu
rodzic
commit
ed8a0fc42b

+ 2 - 2
lgsm/functions/command_comms_check.sh

@@ -6,14 +6,14 @@ lgsm_version="140516"
 
 # Description: Sends a test email notification.
 
-local modulename="Comms Check"
+local modulename="Comms"
 function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
 info_config.sh
 if [ "${emailnotification}" = "on" ]||[ "${pushbulletnotification}" = "on" ]; then
 	fn_scriptlog "Sending Comms Check"
-	commssubject="LGSM - Comms Check -${servername}"
+	commssubject="LGSM - Comms Check - ${servername}"
 	commsbody="LGSM testing comms, how you read?"
 	comms.sh
 else

+ 2 - 2
lgsm/functions/comms.sh

@@ -6,10 +6,10 @@ lgsm_version="140516"
 
 # Description: Overall function for managing notifications.
 
-if [ "${emailnotification}" == "on" ]; then
+if [ "${emailnotification}" == "on" ]||[ -n "${email}" ]; then
 	comms_email.sh
 fi
 
-if [ "${pushbulletnotification}" == "on" ]; then
+if [ "${pushbulletnotification}" == "on" ]||[ -n "${pushbullettoken}" ]; then
 	comms_pushbullet.sh
 fi

+ 3 - 0
lgsm/functions/comms_pushbullet.sh

@@ -6,6 +6,9 @@ lgsm_version="140516"
 
 # Description: Notifications using pushbullet.
 
+local modulename="Comms"
+function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+
 curl -u """${pushbullettoken}"":" -d type="note" -d body="${commsbody}" -d title="${commssubject}" 'https://api.pushbullet.com/v2/pushes' >/dev/null 2>&1
 fn_print_ok_nl "Sent Pushbullet notification"
 fn_scriptlog "Sent Pushbullet notification"