Skip to content

Instantly share code, notes, and snippets.

@ShinkoLab
Created April 21, 2020 10:48
Show Gist options
  • Save ShinkoLab/572aef7921face808315c569c0f57fad to your computer and use it in GitHub Desktop.
Save ShinkoLab/572aef7921face808315c569c0f57fad to your computer and use it in GitHub Desktop.
cf-ddnsを呼び出すやつ
#/bin/bash
# Environment Variables for CloudFlare DDNS
export CF_API_TOKEN="CLOUDFLARE_API_TOKEN"
# Hosts
HOST="FQDN(スペース区切り)"
# Option
IPSRV="https://ipv4.icanhazip.com" #IP取得元
LOG="WARNING" #LogLevel("CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", "NOTSET")
ZONE="ZONE_ID" #Zone ID
# Exec Command
/usr/local/bin/cf-ddns --name $HOST --ip-services $IPSRV --log-level $LOG --zone-id $ZONE
# Check Success
if [ $? = 0 ]; then
exit 0
fi
exit 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment