Skip to content

baandab/checkTailscale.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

checkTailscale.sh

Used to check if Tailscale is working; testing on macOS

Purpose:

Script to restart the Tailscale connection if it is not working. Requires two machines in a network to run.

Dependencies:

See Tailscale at https://tailscale.com/

Usage

./checkTailscale.sh [ -p [ADDRESS] -o [ADDRESS] -n [NAME] [-e] [-i] -s [COUNT] ]

OPTIONS:
-o set the IP address of a second system that is running tailscale to verify that tailscale is working
-n set the user-friendly name of that second system that is running tailscale to verify that tailscale is working
-p set IP address to ping
-e send an email every time this script runs
-i send an email only if there was a problem with the Internet or tailscal
-s skip COUNT errors

Customization:

Edit the script and change these variables:

Variable Description
VERFILE Location of where the version of Tailscale is stored, should not be a temporary location
PUBLIC_IP_ADDRESS The public IP that you want to ping to test if tailscale is working
AUTH_KEY Location of the tailscale AUTH_KEY, get this from the Admin console, see https://tailscale.com/kb/1085/auth-keys/
EMAIL_ADDRESS The email address to send error reports, if enabled via -i or -e when invoking this script
TMPFILE Where to store the temporary file, will be deleted after running
TAILSCALE_OTHER_IP_ADDRESS The IP address of a second system that is running tailscale to verify that tailscale is working
TAILSCALE_OTHER_MACHINE_NAME The user-friendly name of that second system that is running tailscale to verify that tailscale is working

Crontab Example:

This example checks every 15 minutes to see if TailScale is running

##MIN HOUR MDAY MON DOW COMMAND

0,15,30,45 * * * * /Users/me/bin/checkTailscale.sh -i &> /dev/null

About

Used to check if Tailscale is working; testing on macOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages