Created
April 21, 2020 10:48
-
-
Save ShinkoLab/572aef7921face808315c569c0f57fad to your computer and use it in GitHub Desktop.
cf-ddnsを呼び出すやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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