#!/bin/sh

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

# In the background: it asks the server, and netifd handles the next
# interface event only once this script has returned
/etc/init.d/openmptcprouter-vps set_vpn_ip >/dev/null 2>&1 &