Results 1 to 3 of 3

Thread: Start own script in post-boot or post-firewall

  1. #1

    Question Start own script in post-boot or post-firewall

    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

  2. #2
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308
    Do not use post-firewall or post-boot for this, but post-mount instead. The script does not start because the partition isn't mounted yet and therefore the file doesn't exist.

  3. #3
    Thats it, thx, now it works

    Is there somewhere a list with all possible post-XXX scripts?

    Cheers,
    Markus

Similar Threads

  1. Howto run post-boot when ftp is off
    By Jethro in forum WL-500g Q&A
    Replies: 6
    Last Post: 27-08-2005, 21:54
  2. post-firewall script is not being executed
    By Fama in forum WL-500g Q&A
    Replies: 6
    Last Post: 09-08-2005, 09:14
  3. Shell scripts and post-boot
    By samoht in forum WL-500g Q&A
    Replies: 5
    Last Post: 03-06-2005, 23:58
  4. Replies: 9
    Last Post: 18-02-2005, 19:42
  5. Replies: 3
    Last Post: 24-12-2004, 19:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •