• bobz

    This looks a lot better than a lot of the scripts out there for DYNdns login, but when I try the “test” procedure, it fails authentication. I am sure my login info is correct, I even coped/pasted it into the DYNdns login page manually to make sure it works. Here is what I get from the SSH test-

    Tomato v1.28.0000 MIPSR2-103 K26 USB Max
    [email protected]:/tmp/home/root# ls /tmp
    DDNS_LOGIN.sh home script_wanup.sh var
    curl mnt share
    etc pptpd splashd
    [email protected]:/tmp/home/root# cat /var/log/messages | grep DDNS_AUTOLOGIN
    Jan 29 19:58:01 unknown user.notice root: DDNS_AUTOLOGIN – Login Unsuccessful
    [email protected]:/tmp/home/root#

    Any ideas?

  • shadowandy

    bobz,

    As mentioned through email, will need you to comment off line 44 (the rm $OUTPUT) line and paste me the contents of /tmp/DDNSAL.output.

  • Patrick

    Thank you. The dyndns auto login is working on my asus n66u.

  • MY

    # Location of curl binary
    CURL_URL=”http://example.com/curl”
    CURL_EXE=”/tmp/curl”

    Instead of public url, can this be pointing to a folder located in a USB hard disk drive connected to the Tomato Router? If so, can you provide a working example?

    Thanks,

  • shadowandy

    MY,

    Just set the CURL_EXE variable to point to the location of the curl on the usb disk. The codes on line 25 to 28 will skip the download if it finds a executable named curl at the location of CURL_EXE.

  • MY

    I placed the file under:
    CURL_EXE=”/tmp/curl”

    I get
    Mar 9 12:10:32 XXXXX user.notice root: DDNS_AUTOLOGIN – Login Unsuccessful

    When I execute the command from Tomato Tools, System page, I get:

    /tmp/DDNS_LOGIN.sh: line 23: /tmp/curl: Permission denied
    /tmp/DDNS_LOGIN.sh: line 25: /tmp/curl: Permission denied
    rm: can’t remove ‘/tmp/DDNSAL.cookie’: No such file or directory
    rm: can’t remove ‘/tmp/DDNSAL.output’: No such file or directory

    /tmp/curl folder contains 660 kb curl file without any extension and an empty folder named:__MACOSX

  • shadowandy

    MY,

    Can you execute “/tmp/curl –version” and paste me the version and details?

    If it fails to execute, do ensure that /tmp/curl is set to be executable.

  • MY

    I get this:

    [email protected]:/tmp/home/root# /tmp/curl –version
    -sh: /tmp/curl: Permission denied

  • MY

    I had another curl at this location:
    CURL_EXE=”/opt/bin/curl”
    SO, I changed the code as above. Now, I don’t get the “Permission denied” anymore. I commented the lines as follows to see if outputs are generated.
    # rm $COOKIE
    # rm $OUTPUT

    I think the issue is with this line:
    if grep -E “(Welcome|Hi).*$USERNAME” $OUTPUT > /dev/null 2>&1; then

    OUTPUT file does not have “Welcome|Hi” in it.
    When I login to my account, I don’t see “Welcome|Hi”.

    There is Welcome and my username.

  • shadowandy

    MY,

    The Welcome|Hi is actually regular expression so it matches either Welcome or Hi. Do you see that the login is successful in your router logs?

  • MY

    No, not with
    if grep -E “(Welcome|Hi).*$USERNAME” $OUTPUT > /dev/null 2>&1;

    I changed it to read:
    if grep -E “Welcome” $OUTPUT > /dev/null 2>&1;
    Then it is successful.
    I played with every combination of “(Welcome|Hi).*$USERNAME” . It did not work. When I login, I see Welcome XYZ, where XYZ is the username.
    If you can explain ().*, that may be helpful.

  • MY

    I figured out the problem. My Username to login the account is mixed case like: XYz. After logging in to the website, username is converted to lowercase. OUTPUT file contains “Welcome xyz”.
    If I type in
    USERNAME=”xyz”
    then your code works.

  • shadowandy

    MY,

    Thanks for troubleshooting. Cos my username is in lowercase so didn’t realise that DynDNS actually represents the username in lowercase. Glad that it works for you. 🙂

  • MY

    Hi shadowandy,

    Can you write a similar script for no-ip.com. It also requires users to login monthly. I am not sure if a simple login is sufficient or not to keep the account active. It may be necessary to click on “Modify”, then “Update” for each host name.

    Thanks,

Close