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

scripts on cifs

Discussion in 'Tomato Firmware' started by lboregard, Sep 28, 2006.

  1. lboregard

    lboregard LI Guru Member

    this is the setup ...

    1 WRT54GL router
    1 ubuntu box

    the ubuntu box shares a directory for the router to connect to via cifs (/cifs1).
    in this share i have an iptables script which i load in tomato via the scripts > firewall page.

    now, the thing is that the router boots up much faster than the ubuntu box, so it happens that my iptables rules are not applied, i assume it is because that in the boot sequence, the invocation of the user firewall rules happens before the cifs partition is mounted (since the ubuntu box is still booting).

    so i tried to run the script via cifs > the execute when mounted option, but it doesn't work.

    a bug ? can anyone confirm that the execute when mounted works ?
  2. LAGMonkey

    LAGMonkey Network Guru Member

    Just a small note, how do you actually set up a CIFS server? ive been trying to find out the information and i know how to connect clients via CIFS.

    I want to send the bandwidth monitering data to a server so that it wont take up any of the valuable internal RAM (only 16meg on a v2.2 WRT54G).
  3. lboregard

    lboregard LI Guru Member

    a cifs "server" is actually nothing more than a pc sharing some of its directories via the smb/cifs protocol.

    in other words, if you have a windows machine, you can go to the properties of any folder, select sharing tab and go on from there.

    if you have linux machine, then you need to set up the samba service.

    google is your friend in order to install and configure :)
  4. bokh

    bokh LI Guru Member

    [script] hwinfo.sh

    With a topic like this we might as well start posting some useful scripts for WRT and / or Tomato! ;-)

    Here's a very simple script I use to make a webpage with some Linux-related hardware-information - named "hwinfo.sh".
    It was "inspired" by Void Main's "Real Time System Stats": http://voidmain.is-a-geek.net:81/cgi-bin/stats.cgi
    I've put it on the CIFS-share on my FreeBSD-system, with user-homepages enabled. It needs some adaptation: path to file-output, CSS, title, etc.
    Here's how it looks:

    echo "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
       <title>WRT54GL v1.1 - Tomato Stats</title>
       <link rel="stylesheet" type="text/css" href="/style.css" />
    <div id="content">
    ==========[ WRT54GL v1.1 - Tomato Stats ]===========
    <br/>" > $FILE
    echo "=== version ========================================" >> $FILE
    tail -1 /etc/motd >> $FILE
    echo "" >> $FILE
    echo "=== uname -a =======================================" >> $FILE
    uname -a >> $FILE
    echo "" >> $FILE
    echo "=== uptime =========================================" >> $FILE
    uptime >> $FILE
    echo "" >> $FILE
    echo "=== cat /proc/cpuinfo ==============================" >> $FILE
    cat /proc/cpuinfo >> $FILE
    echo "" >> $FILE
    #echo "=== cat /proc/pci ==================================" >> $FILE
    #cat /proc/pci >> $FILE
    #echo "" >> $FILE
    echo "=== ps =============================================" >> $FILE
    ps >> $FILE
    echo "" >> $FILE
    echo "=== cat /proc/meminfo ==============================" >> $FILE
    cat /proc/meminfo >> $FILE
    echo "" >> $FILE
    echo "=== cat /proc/modules ==============================" >> $FILE
    cat /proc/modules >> $FILE
    echo "" >> $FILE
    echo "=== free ===========================================" >> $FILE
    free >> $FILE
    echo "" >> $FILE
    echo "=== df -h ==========================================" >> $FILE
    df -h >> $FILE
    echo "</pre></div><br/></body></html>" >> $FILE
  5. Urko

    Urko Network Guru Member

    Is it possible to save Bandwidth Monitoring history on a ftp server ?
    Is it possible, if router is rebootet that it remembers WAN Bandwidth - Monthly, Daily?
  6. bokh

    bokh LI Guru Member

    No, not possible (at least not yet).

    Yes, but ONLY if saved off-site e.g. on a CIFS-share (shared folder on a Windows-host or Samba-share on Unix / Linux). However, I'm not completely sure about the possibilities of JFFS2...

Share This Page