$ mydnsjp-update mydns999999 MyPassw0rd
Last active
August 29, 2015 14:24
-
-
Save koron/6bd3eaaac15b98947b2d to your computer and use it in GitHub Desktop.
update mydnsjp entry.
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/sh | |
# vim:set sts=2 sw=2 tw=0 et: | |
( | |
export LANG=C | |
export PATH="/usr/local/bin:${PATH}" | |
id="$1" ; shift | |
passwd="$1" ; shift | |
url="http://www.mydns.jp/login.html" | |
curl -sfi "$url" -u "${id}:${passwd}" >/dev/null 2>&1 | |
if [ $? != 0 ] ; then | |
tmpfile=$(mktemp /tmp/mydns-update.XXXXXX) | |
curl -vsi "$url" -u "${id}:${passwd}" >"$tmpfile" 2>&1 | |
if [ $? != 0 ] ; then | |
echo "ERROR: $0 failed" | |
cat "$tmpfile" | |
fi | |
rm -f "$tmpfile" | |
fi | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment