alert_pushbullet.sh 811 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. # LGSM alert_pushbullet.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. lgsm_version="210516"
  6. # Description: alerts using pushbullet.
  7. modulename="Alert"
  8. function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  9. fn_print_dots "Sending Pushbullet alert"
  10. sleep 1
  11. 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)
  12. if [ "${pushbulletsend}" == "invalid_access_token" ]; then
  13. fn_print_fail_nl "Sending Pushbullet alert: invalid_access_token"
  14. fn_script_log "Failure! Sending Pushbullet alert: invalid_access_token"
  15. else
  16. fn_print_ok_nl "Sending Pushbullet alert"
  17. fn_script_log "Complete! Sent Pushbullet alert"
  18. fi