Change www folder ?

Discussion in 'Tomato Firmware' started by meeces2911, Mar 3, 2010.

  1. meeces2911

    meeces2911 Addicted to LI Member

    Does anyone know how i could change the www folder to be a sym link to /tmp/www or something, so that all the webpages are in a writeable area of the routers memory/flash. (not quite sure how the /tmp folder works, weather its nor, or ram storage [or am i completely off :confused:?])

    I have a Asus RT-N16 so, ram and flash space isnt a problem (ie, dont really care about stripping the white space)
  2. teddy_bear

    teddy_bear Network Guru Member

    You can copy the whole /www directory to any writable partition - it could be /jffs, or a partition on your USB drive, or RAM (/tmp) - and bind-mount the copy on the original directory, i.e.:
    mount -o bind /jffs/www /www
  3. meeces2911

    meeces2911 Addicted to LI Member

    Ah, right, thanks... never thought of that :p
  4. meeces2911

    meeces2911 Addicted to LI Member

    cp -R /www /tmp/www
    for F in /tmp/www/qos-*.asp; do \
    sed \
    -e "s/'Highest',/'Service',/" \
    -e "s/'High',/'Games',/" \
    -e "s/'Medium',/'Media',/" \
    -e "s/'Low',/'Remote',/" \
    -e "s/'Lowest',/'WWW',/" \
    -e "s/'Class A',/'Mail',/" \
    -e "s/'A',/'Mail',/" \
    -e "s/'Class B',/'Messenger',/" \
    -e "s/'B',/'Messenger',/" \
    -e "s/'Class C',/'Download',/" \
    -e "s/'C',/'Download',/" \
    -e "s/'Class D',/'P2P\/Bulk',/" \
    -e "s/'D',/'P2P\/Bulk',/" \
    -e "s/'Class E'[]];$/'Crawl'];/" \
    -e "s/'E'[]];$/'Crawl'];/" \
    <$F >$F.tmp; \
    rm $F; \
    mv $F.tmp $F; \
    mount -o bind /tmp/www /www
    This is what im using at the moment to rename any version of tomato i use. (The only thing i have found is it doesn't change the pie graph names (yet).)
    I have this code running in the Init script... now what i would like to know, is if there is any better place to put this, or even any advice on how to improve the script.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice