#!/bin/sh

for IPV4 in $(find /tmp -type f -name "newwanip_*"); do
	INTERFACE=$(cat "${IPV4}")
	rm "${IPV4}"

	echo -n "Reconfiguring IPv4 on ${INTERFACE}: "
	configctl interface newip ${INTERFACE}
done

for IPV6 in $(find /tmp -type f -name "newwanipv6_*"); do
	INTERFACE=$(cat "${IPV6}")
	rm "${IPV6}"

	echo -n "Reconfiguring IPv6 on ${INTERFACE}: "
	configctl interface newipv6 ${INTERFACE}
done
