Skip to content

ErSoul/sms-server-up

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTIFY SERVER IS UP (SMS)

DESCRIPTION

Notifies when the computer powered on using the Telesign or Twilio

The script uses a .env file that should contain the variables needed for the script to work properly.

USAGE

After setting up the values in the .env file you should add the following to your crontab:

@reboot /path/to/your/script/notify-server-up.sh >> /var/log/notify-sms.log

NOTES

For some reason the base64 string generated by the telesign_encode_credentials function differs on the last character, in contrast of the one generated in https://developer.telesign.com/enterprise/reference/sendsms. That's why I had to add the sed s/K$/=/ to the output, but in normal circunstances I guess it shouldn't be needed.

Note that the value for PHONE_TARGET must have the + character as prefix when using Twilio, but not for Telesign.

NOTIFY TERMUX IS PLUGGED

DESCRIPTION

This script will alert when the server has been unplugged from AC Power. and when it's connected again. It does that by getting the current status from $STATE_FILE.

It is recommended that $STATE_FILE should be in a volatile mountpoint, like a tmpfs filesystem, though, not a requirement...

The notification goes through a ntfy.sh topic.

USAGE

* * * * * /path/to/your/script/notify-termux-plugged.sh >> /var/log/termux-battery.log

TODO

Due to a termux environment is very homogenous, the script shall automate the dependencies installation.

About

Script to alert when a computer is on

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages