Skip to content

Instantly share code, notes, and snippets.

@hotoracle
hotoracle / ipsec-monitor.sh
Created February 9, 2019 06:22 — forked from winhamwr/ipsec-monitor.sh
Script to check the status of ipsec tunnels and refresh them if they're down. This should be run from cron every minute. To add monitoring on a tunnel, add a commented-out `monitor` line with the IP and port to use for establishing connection status. eg. `#monitor 172.17.105.80 9898` Adapted from a script posted by user "c b" on Strongswan [issu…
#!/bin/bash
function main()
{
monitor_from_file $*
}
function monitor_vpn_ip_port()
{
local CONN_NAME=$1