#!/bin/sh
#
# $NetBSD: tinydyndns-call-update.sh,v 1.2 2020/10/19 07:15:55 schmonz Exp $
#
# tinydyndns-run-20250425 program to update DNS record for POP3 authenticated user.

if [ $# -eq 0 ]; then
	echo "usage: $0 program" >&2
	exit 1
fi

echo "login: ${USER}: ${TCPREMOTEIP}" >&7
cd /usr/pkg/etc/tinydyn
/usr/pkg/bin/setlock data.cdb \
	/usr/pkg/bin/tinydyndns-update ${USER}.$(/usr/bin/head -1 domain) ${TCPREMOTEIP} >&7 \
	2>&1
exec "$@"
