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

Can't run cgi-scripts

Discussion in 'Tomato Firmware' started by MrNova, Oct 15, 2013.

  1. MrNova

    MrNova Reformed Router Member

    I'm compiling recent builds from GIT (tomato-k26USB-1.28.MIPSR2-VPN) with standard plus VPN and extras. I've been trying to run custom scripts by placing them in the /www/ext/cgi-bin folder (both directly and by enabling jffs, placing script in /jffs, and linking to /www/ext/cgi-bin) and setting chmod +x.

    However when I attempt to run them I get a generic file not found error. For example I created a file "env.sh" and placed it in the folder a variety of different ways. I then try to go to http://routerip/ext/cgi-bin/env.sh, but I get an error ./tmp/.[RANDOMCHARS] line 5: /ext/cgi-bin/env.sh: not found

    I can run the file just fine by telneting in and running sh env.sh from command line. Any thoughts? Sample of the script below:


    echo Content-type: text/html
    echo ""

    cat << EOM
    <HEAD><TITLE>File Output: /home/user1/public_html/text-file.txt </TITLE>
    <BODY bgcolor="#cccccc" text="#000000">


    cat << EOM
  2. MrNova

    MrNova Reformed Router Member

    Doh stupid me. Needed to change top line to /sh instead of /bash :oops:

Share This Page