diff --git a/changelog b/changelog index 74d060de5cf109bec0b83174c4222da8f5f54417..ef8ad1f6ae7e0987d40dce869f4666935b1f76d5 100644 --- a/changelog +++ b/changelog @@ -11,5 +11,6 @@ Time-stamp: <2012-05-27> - only update when IP is different from last successful update. - send email to EMAIL and FATAL_ERROR_EMAIL. - check IP is a valid public IP. + - check config is valid. * v0.1.0 - init version. was used to update sylecn01.dnsd.me. diff --git a/src/bin/ddclient-http b/src/bin/ddclient-http index 26ff4bc419fe07ee8386e9b4a1f42a9706cf192c..2443dfd5e6d889f9ae427f5c723f9394ce0e48ce 100755 --- a/src/bin/ddclient-http +++ b/src/bin/ddclient-http @@ -40,7 +40,7 @@ log() { # Usage: err [MESSAGE..] err() { logger -t ddclient_http -p user.err "$@" - echo "$@" | mail -s "ddclient-http Error" ${EMAIL:-root@localhost} + echo -e "$@" | mail -s "ddclient-http Error" ${EMAIL:-root@localhost} } # Usage: fatal_err [MESSAGE..] @@ -48,7 +48,7 @@ err() { # it's set in config file. fatal_err() { err "$@" - test -z "$FATAL_ERROR_EMAIL" || echo "$@" | mail -s "ddclient-http FATAL Error" "$FATAL_ERROR_EMAIL" + test -z "$FATAL_ERROR_EMAIL" || echo -e "$@" | mail -s "ddclient-http FATAL Error" "$FATAL_ERROR_EMAIL" } # which host to update and it's credentials. @@ -58,16 +58,16 @@ if [ -f "$CONFIG_FILE" ]; then # check that config file is valid. msgs="" if [ -z "$HOSTNAME" -o -z "$USERNAME" -o -z "$PASSWORD" ]; then - msg=$msg"Error: HOSTNAME, USERNAME, or PASSWORD is not set.\n" + msg=$msg"HOSTNAME, USERNAME, or PASSWORD is not set.\n" fi if [ `echo -n "$USERNAME" | wc -m` -gt 24 ]; then - msg=$msg"Error: USERNAME should be less than 24 characters.\n" + msg=$msg"USERNAME should be less than 24 characters.\n" fi if [ `echo -n "$PASSWORD" | wc -m` -gt 24 ]; then - msg=$msg"Error: PASSWORD should be less than 24 characters.\n" + msg=$msg"PASSWORD should be less than 24 characters.\n" fi if [ -n "$msg" ]; then - fatal_err `printf "Error: Bad config file. $msg"` + fatal_err "`printf "Error: Bad config file.\n$msg"`" exit $BAD_CONF fi else