Skip to content

Shell scripts that help automating the switch-over to another internet provider

License

Notifications You must be signed in to change notification settings

theyo-tester/auto-failover-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Purpose

A bash script that will check internet connectivity and, if needed, will switch to the "backup" or back to "main" ISP if main is available meanwhile. It was only tested on a debian system, but should similarly work on other linux based systems.

Install

  1. copy this script on your linux machine (tested on debian only!)
  2. Change the first part of the script, where you specify the correct interfaces and IPs used for main and backup.
  3. You can call it periodically with crontab. For example, if you want to check the connectivity every 20 seconds, you can achieve this by adding this cron entries (edit with crontab -e):
* * * * * /home/<user>/failover/failover.sh
* * * * * sleep 20; /home/<user>/failover/failover.sh
* * * * * sleep 40; /home/<user>/failover/failover.sh

To Do

  • Add possibility to specify a hookup, generically (script or command), for main->backup & backup->main switch-over
  • Make configuration external, f.i. with an .env file
  • Create a installation script, with a default way of setting things up.

About

Shell scripts that help automating the switch-over to another internet provider

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages