This repository has been archived on 2024-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
freedns_updater/update-freedns.sh

20 lines
445 B
Bash

#!/bin/bash
TOKEN_FILE="/var/local/dns_updater/key"
if [ -e "$TOKEN_FILE" ]; then
TOKENS=`cat $TOKEN_FILE`
elif [ ! -z "$TOKENS" ]; then
echo "Adding TOKENS to token file, first run."
echo "$TOKENS" > $TOKEN_FILE
else
echo "TOKENS must be set on first start."
exit 1
fi
readarray -d ";" -t tokenarr <<< "${TOKENS}"
for token in ${tokenarr[@]}
do
echo -n "`date` : " && curl -s "https://sync.afraid.org/u/${token}/"
done