I've used this for awhile now as a quick way to control some things on my raspberry pis running in my home from my phone.
Sometimes you just want something quick and a little bash script is perfect. For example, I use getmail to periodically fetch my email from all of my email providers, gmail, hotmail, etc.. Whenever I needed to get email quicker (like if I was sent a security code or something) I had to SSH into the server and manually call getmail to fetch it before the scheduled time. With pushback I have a little simple script that gives me the ability to do it from the pushback app and it is a real time saver.
Here is my script I used in case anyone is interested:
#!/bin/bash
while true; do
result="$(curl https://api.pushback.io/v1/send_sync \
-u <my_token>: \
-d 'id=Channel_379' \
-d 'title=Check Email?' \
-d 'body=Choose from the actions' \
-d 'action1=gmail' \
-d 'action2=hotmail' \
-d 'action3=personal')"
if [[ "$result" == "gmail" ]]; then
getmail -r gmail
elif [[ "$result" == "hotmail" ]]; then
getmail -r hotmail
elif [[ "$result" == "personal" ]]; then
getmail -r personal
fi
sleep 15
done
I've used it to also notify me when long running commands finish, as a way to add manual review to an otherwise automated process, etc.
Sometimes you just want something quick and a little bash script is perfect. For example, I use getmail to periodically fetch my email from all of my email providers, gmail, hotmail, etc.. Whenever I needed to get email quicker (like if I was sent a security code or something) I had to SSH into the server and manually call getmail to fetch it before the scheduled time. With pushback I have a little simple script that gives me the ability to do it from the pushback app and it is a real time saver.
Here is my script I used in case anyone is interested:
I've used it to also notify me when long running commands finish, as a way to add manual review to an otherwise automated process, etc.