#!/bin/sh

# Selfhost DynDns Update
# Usage:
# IPv4 Update: selfhost-update
# IPv6 Update: selfhost-update -6
# Note, min 30 seconds between calls! (rate limit)

ID=$(pass Internet/selfhost.de | grep DynDnsUser | cut -d" " -f2)
PW=$(pass Internet/selfhost.de | grep DynDnsPass | cut -d" " -f2)

set -x
curl $1 "https://$ID:$PW@carol.selfhost.de/nic/update?textmodi=1"
