From 0805246011c4d571cb38a098a3f36311be8f12da Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 15 Oct 2023 22:14:25 +0100 Subject: [PATCH] refactor: improve Pushbullet alert sending The code in the `alert_pushbullet.sh` file has been refactored to improve the way Pushbullet alerts are sent. The curl command now includes the access token as a header instead of in the URL, resulting in more secure communication with the Pushbullet API. This change enhances the reliability and security of sending Pushbullet alerts. --- lgsm/modules/alert_pushbullet.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh index 3bcd6141b0..e1f19c507a 100644 --- a/lgsm/modules/alert_pushbullet.sh +++ b/lgsm/modules/alert_pushbullet.sh @@ -19,7 +19,8 @@ EOF ) fn_print_dots "Sending Pushbullet alert" -pushbulletsend=$(curl --connect-timeout 10 -sSL -u """${pushbullettoken}"":" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code") + +pushbulletsend=$(curl --connect-timeout 10 -sSL -H "Access-Token: ${pushbullettoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code") if [ -n "${pushbulletsend}" ]; then fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}"