morristech
5/30/2019 - 9:46 PM

Set up pushbullet boot notifications for a raspberry pi

Set up pushbullet boot notifications for a raspberry pi

# Multiple sources here:
# https://atinkerersblog.wordpress.com/2014/07/26/get-notified-when-your-raspberry-pi-is-booted-with-pushbullet/
# - follow the steps to make rc.local executable below
# this script is a compilation of all three below
# https://learnraspi.com/get-notifications-raspberry-pi-pushbullet/
# http://biosrhythm.com/?p=1151
# http://askubuntu.com/questions/9853/how-can-i-make-rc-local-run-on-startup

# create the pushbullet script
$ sudo nano /usr/bin/notify.sh

# paste this into notify.sh
---------------------------
#!/bin/bash

# Save this as notify.sh in /bin/bash/ with executable permissions
# bash /bin/bash/notify.sh "Alert title" "Message body"

TOKEN="[PUT YOUR ACCESS TOKEN HERE]"
curl -u $TOKEN: https://api.pushbullet.com/v2/pushes -d type=note -d title="TITLE" -d body="BODY"
---------------------------

# make it writable

$ sudo chmod +x /usr/bin/notify.sh

# test it

$ /usr/bin/notify.sh

# add script to rc.local

$ sudo nano /etc/rc.local

# Insert /usr/bin/notify.sh before exit 0

/usr/bin/notify.sh

exit 0

# save rc.local

ctrl+x Y ENTER

# Make your /etc/rc.local executable in case it is not already executable by

$ sudo chown root /etc/rc.local
$ sudo chmod 755 /etc/rc.local

# Check everything works fine by executing

$ sudo /etc/init.d/rc.local start

# Bam pushbullet notification

$ sudo reboot

# reboot finishes

# BAM pushbullet notification