From ed8a0fc42b9e41d3175e1634ed4035212e66d2b3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 14 May 2016 23:05:18 +0100 Subject: [PATCH] check that token and email are present --- lgsm/functions/command_comms_check.sh | 4 ++-- lgsm/functions/comms.sh | 4 ++-- lgsm/functions/comms_pushbullet.sh | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/command_comms_check.sh b/lgsm/functions/command_comms_check.sh index dcf173661..1d401d948 100644 --- a/lgsm/functions/command_comms_check.sh +++ b/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 diff --git a/lgsm/functions/comms.sh b/lgsm/functions/comms.sh index ed1172cea..1d5a9a091 100644 --- a/lgsm/functions/comms.sh +++ b/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 \ No newline at end of file diff --git a/lgsm/functions/comms_pushbullet.sh b/lgsm/functions/comms_pushbullet.sh index 8cca21483..def5717e9 100644 --- a/lgsm/functions/comms_pushbullet.sh +++ b/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"