Hi,
(on a WL-500g with Olegs last firmware v1.9.2.7 CR6b)
I have the idea to start a script in the post-firewall or post-boot
(/usr/local/sbin/...) script
with the commands:
#!/bin/sh
if [ -e /tmp/harddisk/autochk.sh ]; then
/tmp/harddisk/autochk.sh &
fi
which should run in the background and checks if a special
file is copied to the ftp_pub directory.
If this file was found it should be executed ... for example to:
- download a file from the internet or to
- send a wakeup frame to the server in the LAN.
After execution it should be deleted.
The autochk.sh looks like this:
#!/bin/sh
cd /tmp/harddisk/ftp_pub/
sleep 63
while [ 1 ] ; do
sleep 63
if [ -e /tmp/harddisk/ftp_pub/command.txt ]; then
echo Execute /tmp/harddisk/ftp_pub/command.txt
chmod -x /tmp/harddisk/ftp_pub/command.txt
. /tmp/harddisk/ftp_pub/command.txt
printf "subject:Router-Feedback\nto:xyz@arcor.de\nscript finished\n`date`\n`more /tmp/harddisk/ftp_pub/xyz.txt`\n" | mini_sendmail -v -t
-fxyz@arcor.de -smail.arcor.de
xyz@arcor.de
rm /tmp/harddisk/ftp_pub/KOMMANDO.txt
fi
done
But if I add this script to post-firewall it seems it will not be started
(I can't see it with 'top' or 'ps -f') but if I start it by hand (via telnet)
then it works like expected.
Now the questions :
1. Can I start an own script in one of these files (post-boot or post-firewall) or why not?
2. If I start it with '&' at the end ... is it really running in an own process without influencing anything else?
3. Do I have to expect any trouble with the router if I do this (like: not enough ram, to slow etc.)
Thx
Markus