Skip to content

Instantly share code, notes, and snippets.

@FelipeGrijo
Created June 22, 2017 14:16
Show Gist options
  • Save FelipeGrijo/3c437755768c54e771d129540e5f2d5f to your computer and use it in GitHub Desktop.
Save FelipeGrijo/3c437755768c54e771d129540e5f2d5f to your computer and use it in GitHub Desktop.
Verifica constantemente um arquivo, e envia um alerta via Pushbullet caso tenho sido alterado.
#!/bin/bash
#sudo apt install inotify-tools
#Envia um alerta no PushBullet quando o arquivo for alterado
#https://gist.github.com/FelipeGrijo
while inotifywait -q -e modify LOCAL-DO-ARQUIVO >/dev/null;
do
API="SUA-API"
MSG="$1"
Title="Arquivo-Sincronizado"
curl -u $API: https://api.pushbullet.com/v2/pushes -d type=note -d title="$Title" -d body="$MSG"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment