I'm trying to make a very simple shell script to run as a CGI on a uhttpd server running on an OpenWRT install.
The file is called /www/cgi-bin/first.cgi and looks like...
#!/bin/sh
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Bash as CGI"
echo "</title></head><body>"
echo "<h1>Hello world</h1>"
echo "Today is $(date)"
echo "</body></html>"
...and I did a
chmod +x first.cgi
on the file.
When I try to pull up...
http://192.168.15.1/cgi-bin/first.cgi
...the browser gets...
Unable to launch the requested CGI program:
/www/cgi-bin/first.cgi: Text file busy"
I can cat and vi the file from a shell prompt, so not sure how the file is busy or even how I would find out.
What am I doing wrong?