aboutsummaryrefslogtreecommitdiff
path: root/net/libreswan/files/etc/hotplug.d/iface/89-libreswan
blob: 9ebc6181508e24f6eb66e2682a8442bba70c2cd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0

/etc/init.d/ipsec running || exit 0
uci show libreswan | grep -i "='$INTERFACE'$" || exit 0

logger -t libreswan "Restart libreswan due to $ACTION of $INTERFACE ($DEVICE)"

/etc/init.d/ipsec restart