#! /bin/sh # Restart ipsec service (openswan) when an interface comes up, to allow it to know # about new interfaces set -e # Don't bother to restart openswan when lo is configured. if [ "$IFACE" = lo ]; then exit 0 fi # Only run from ifup. if [ "$MODE" != start ]; then exit 0 fi # Is /usr mounted? if [ ! -e /usr/sbin/ipsec ]; then exit 0 fi if [ ! -f /var/run/pluto/pluto.pid ] || \ [ "$(ps -p "$(cat /var/run/pluto/pluto.pid)" -o comm=)" != pluto ]; then exit 0 fi service ipsec stop || true service ipsec start || true exit 0