I hope its ok to start a new thread, I was going to use my existing one but thought a new one would better clarify things and provide better search for future reference.
Well I have my bash program working now, all nice, user input validated, output formatted, everything is looking sexy.
Now the guys tell me that they don't want telnet access to the server, grrrrrrr! I have to make
an idiot proof web interface.
So I need to choose a way to go. As I see it I can either re-write the whole thing in perl or
somehow 'wrap' my bash into a cgi interface.
I've been thinking about the latter option and it seems non-trivial to me at this stage. On the face of it my thinking goes something like this pseudocode:
1) Spawn a copy of my bash script and background it&
while[1] do
2) Take the standard output of the script and redirect it to a little HTML wrapper something like
echo "content-type: text\/html \<html\> <body>
$MYSTDOUTHERE \</html\>\</body\>"
3) process a POST request and send the relevant data to my backgrounded script
done
While I can express the concept clearly enough (I hope) the details are a bit fuzzy and I would welcome any input or comments before getting started. Is such a method possible/reliable/secure?
The web interface would only be used by trusted administrators but I am worried enough about 'command substitution' in any situation where CGIs are involved, its my natural paranoid stance
all best regards
Andy