Files
shell/tools/duckdns/update.sh
2025-07-05 10:23:59 +08:00

24 lines
491 B
Bash
Executable File

#!/bin/bash
# shellcheck disable=SC1091
thisdir="$( dirname "$(readlink -e -- "${BASH_SOURCE[0]}")")"
[ ! -f "$thisdir/.env" ] && {
echo "ERROR: .env not exists"
exit 1
}
source "$thisdir/.env"
[ -z "$DUCK_TOKEN" ] && {
echo "ERROR: env var DUCK_TOKEN not specified"
exit 1
}
[ -z "$DUCK_DOMAINS" ] && {
echo "ERROR: env var DUCK_DOMAINS not specified"
exit 1
}
curl -k "https://www.duckdns.org/update?domains=${DUCK_DOMAINS}&token=${DUCK_TOKEN}&ip=${DUCK_IP}"