alert_pushbullet.sh 793 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. # LGSM alert_pushbullet.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: alerts using pushbullet.
  6. local modulename="Alert"
  7. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  8. fn_print_dots "Sending Pushbullet alert"
  9. sleep 1
  10. pushbulletsend=$(curl --silent -u """${pushbullettoken}"":" -d type="note" -d body="${alertbody}" -d title="${alertsubject}" 'https://api.pushbullet.com/v2/pushes'|grep -o invalid_access_token|uniq)
  11. if [ "${pushbulletsend}" == "invalid_access_token" ]; then
  12. fn_print_fail_nl "Sending Pushbullet alert: invalid_access_token"
  13. fn_script_log_fatal "Sending Pushbullet alert: invalid_access_token"
  14. else
  15. fn_print_ok_nl "Sending Pushbullet alert"
  16. fn_script_log_pass "Sent Pushbullet alert"
  17. fi