Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- set -eu
- #FETCH="fetch -qo -"
- # or for curl:
- FETCH="curl -s"
- # $1: your domain
- # $2: subdomain to update use @ for TLD
- # $3: the password given to you by Namecheap's web interface
- #
- # Rerun this script every 5 minutes. Crontab entry (not as root):
- # */5 * * * * namecheap bla.com www asdjfasfasdfasdf
- domain=$1
- host=$2
- password=$3
- out=$(${FETCH} "https://dynamicdns.park-your-domain.com/update?host=${host}&domain=${domain}&password=${password}")
- grep -q "<ErrCount>0</ErrCount>" <<EOF && exit 0
- ${out}
- EOF
- cat <<EOF
- ${out}
- EOF
- exit 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement