1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Reboot and automatically run firewall script

Discussion in 'Tomato Firmware' started by yia_hara, Jun 7, 2008.

  1. yia_hara

    yia_hara LI Guru Member

    I am trying to get a firewall script created by Firewall Builder to persist post reboot and get automatically executed by Tomato (version 1.19). The script works and runs fine but is deleted upon reboot. I would appreciate any help as to how it can be saved/accessed after a fresh reboot or power-up. It is too large too large to fit in the script area under Administration.

    Thanks!
     
  2. mstombs

    mstombs Network Guru Member

    You should look at enabling the non volatile jffs
     
  3. yia_hara

    yia_hara LI Guru Member

    I figured that jffs2 may be the answer, however, I'm struggling to figure out how I can copy files in that area and how I can reference and execute scripts from there. Very much a newbie in the non-Windows world. Any pointers would be much appreciated.
     
  4. mstombs

    mstombs Network Guru Member

    After enabling/formatting/rebooting your router has a /jffs directory which should be non-volatile.

    I recommend you enable ssh access to the router and use "winscp" to copy files from windows machine.

    Use "notepad++" or similar on windows to save scripts with UNIX format line endings (notepad corrupts).

    Bash scripts need to have a shebang "#!/bin/sh" as first line, and be made executable (from a ssh/telnet command line "chmod +x" or use properties in winscp).

    To call from a firewall script you just put a full path to the file in the GUI

    /jffs/myscript.sh

    (extension .sh is optional, but notepad++ recognizes these are shell scripts and can display with coloured syntax format)

    Hope that gives you a big step forward, or more ideas to Google for!
     
  5. yia_hara

    yia_hara LI Guru Member

    Thank you. That was a huge step forward. Exactly what I was looking for.
     

Share This Page