Skip to content

Commit

Permalink
Convert FreeDNS username to lowercase before hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
justinthomas committed Nov 29, 2022
1 parent 9ff9649 commit ce1b34e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ConfigureFreedns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ clear

if [ $go_back -lt 1 ] # if 7
then
# As per the FreeDNS api (https://freedns.afraid.org/api/),
# the username must be lowercase.
local user_lowercase=$(echo "$user" | awk '{print tolower($0)}')

arg1="https://freedns.afraid.org/api/?action=getdyndns&v=2&sha="
arg2=$(echo -n "$user|$pass" | sha1sum | awk '{print $1;}')
arg2=$(echo -n "$user_lowercase|$pass" | sha1sum | awk '{print $1;}')
arg="$arg1$arg2"

wget -O /tmp/hosts "$arg"
Expand Down

0 comments on commit ce1b34e

Please sign in to comment.