Termux Bash script for checking internet connection by periodically pinging some host and showing notifications with LED and vibration when connection is lost or established using termux-notification API
- Termux
- Termux:API add-on
- Execute the following commands to place script
termux-pinger.sh
into the home directory with the proper permissions (get the link to the raw termux-pinger.sh below):
curl -O https://gist.githubusercontent.com/gpchelkin/b18916c56ff7c759860725a28a747242/raw/b8aa96bb2c7e1dac84f854980eaeb6cd194dde4f/termux-pinger.sh
chmod +x termux-pinger.sh
- Now you can run it like this:
./termux-pinger.sh
- Tasker
- Termux:Task add-on
- In Termux:
mkdir -p ~/.termux/tasker && mv termux-pinger.sh ~/.termux/tasker
- In Tasker: Tasks — Add a new task
pinger
— Add an action — Plugin — Termux:Task — Edit Configuration — Executable:termux-pinger.sh
, Arguments: empty, Execute in a terminal session: disabled — Save — Exit. - In your launcher (I recommend Nova): Add Widget — Tasker — Task Shortcut — Choose task
pinger
and add icon — I dunno what's next