1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help installing curl to tomato firmware

Discussion in 'Tomato Firmware' started by greenythebeast, Sep 21, 2009.

  1. greenythebeast

    greenythebeast LI Guru Member

    Well, I tried using DDWRT so I could install curl on my router to run a certain script I use. I found DDWRT to be really complicated and not as easy as Tomato. So I've reinstalled Tomato on my WL-500GPv2. I've enabled my JFFS2 partition and set it up so I could download and install ipkg from openwrt's website. When I run the command 'ipkg status' from telnet I get the following results:

    # ipkg status
    Package: zlib
    Status: install ok installed
    Root: /jffs
    Version: 1.2.3-5

    Package: libopenssl
    Status: install ok installed
    Root: /jffs
    Version: 0.9.8i-3.2

    Package: libcurl
    Status: install ok installed
    Root: /jffs
    Version: 7.17.1-1.1

    Package: curl
    Status: install ok installed
    Root: /jffs
    Version: 7.17.1-1.1

    So everything is installed correctly. But when I run the command 'curl' in telnet I get the following results:

    -sh: curl: not found

    Can someone please tell me what I'm doing wrong? I feel like I'm really close to finally figuring this out, and would really appreciate some help. Thanks.
     
  2. Planiwa

    Planiwa LI Guru Member

    What is the pathname of the curl binary?
    Perhaps you need to tell the shell?
    Either with the PATH variable, by invoking it with its full pathname, rather than just "curl", or by making a symbolic link from the binary on the jffs to /root.

    The default path is:

    echo $PATH

    /bin:/usr/bin:/sbin:/usr/sbin:/home/root:

    That's where the shell knows to look, by default.
     
  3. greenythebeast

    greenythebeast LI Guru Member

    Alright, so I set the path correctly, and low and behold, curl worked as advertised. So I went to set up a cron job using cru, specifically:

    0 6 * * * sh /opt/script/AutoLogin.sh

    This was last night when the path was set and curl was working correctly. This morning when I turned my computer on and attempted to access the internet, my login page still came up. So I telnet'd into the router and attempted to run curl. This time it, once again, said not found. I reset the path and it worked again. So it seems the router forgot the path overnight. Am I doing something wrong?
     
  4. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    You could just not rely on the path and use the full path to curl when your script uses it.
     
  5. greenythebeast

    greenythebeast LI Guru Member

    Actually, I just flashed my router with the custom USB firmware and now curl works perfectly. Even after reboot, curl is functional. It must be due to optware being run off the USB drive instead of JFFS. Thanks for your help.
     

Share This Page