What would be the simplest way to deal with a text file using JSP?
- by Nano Taboada
First and foremost I should acknowledge that I have no experience at all using Java ServerPages, but I'm positive about achieving this task if you guys help me out a bit since it doesn't seem like something difficult for a seasoned JSP programmer.
Anyway the thing is, there's an actual running JSP application within a *NIX box which I somewhat administer with kind of good permissions. The idea is to create a new but dead simple JSP page to control some Korn Shell scripts I've got running there. So the goal is to make some sort of HTML form that will be writing some kind of scriptStatus.on / scriptStatus.off file:
#!usr/bin/ksh
# coolScript.sh
# This is my cool script that is being launched by cron every 10 minutes.
if [ -e scriptStatus.off ]
then
# monitor disabled
else
# monitor enabled
fi
which then can be checked for existence within the running script, therefore allowing to easily activate / deactivate it without actually have do deal with cron. Please let me know if all this does make any sense and don't hesitate to ask as much questions as needed.
Thanks much in advance!