How to auto-restart WireGuard programmatically if tunnel fails?

Add the following line to /etc/crontabs/root:

* * * * * /usr/bin/wireguard_watchdog

and restart cron:

/etc/init.d/cron restart
1 Like