What's new

TIP: How to use modified webpages for the webui

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

RMerlin

Asuswrt-Merlin dev
Something that was asked a couple of times: how can you replace one of the webui pages without having to recompile the firmware?

First, you need to make a complete copy of the router's /www folder into a USB disk. Assuming your disk is mounted under /mnt/usb1/:

Code:
mkdir /mnt/usb1/www
cp -a /www/* /mnt/usb1/www

Next, if using ext2/ext3, make these pages writable:

Code:
chmod -R a+rwx /mnt/usb1/www/*

Now the fun part: we want to tell the router to mount that writable folder on the USB disk on TOP of the router's /www directory. This is called a "bind mount".

Code:
mount /mnt/usb1/www /www -o bind

And now, to tell the httpd service to restart itself, so it can notice the change:

Code:
service restart_httpd

There you go. The webui will still access the web content from /www, except that this folder will now point to the content from the USB disk instead of the content flashed in the firmware. So if you make any change:

Code:
nano -w /www/Advanced_Wireless_Survey.asp

You will be able to write your changes back. They will be stored on the USB disk, but the web server will be redirected to that content.

To have those modified pages used at every reboot, just have a services-start script to do the mount:

Code:
#!/bin/sh
mount /mnt/usb1/www /www -o bind
service restart_httpd

From now on, your router will be serving the pages from your USB disk.


Those bind mounts can be used for a lot of things. You just modified the "dnsmasq" binary, and want your router to always use the modified version? No problem - you can apply this to a single binary file as well.

Put the modified dnsmasq binary in the JFFS partition, inside /jffs/ (so it becomes available earlier than USB disks, which get mounted quite late)

Then, in init-start:

Code:
#!/bin/sh
mount /jffs/dnsmasq /usr/sbin/dnsmasq -o bind

From now on, whenever the router will run the dnsmasq daemon, it will always use your modified version instead of the one flashed in the router's firmware.
 
Hi RMerlin,
thanks for the post, I got all the asp files on my working PC to see what I can do to fix the switch for the 2 wan you implemented on the previous fw 270 dw .
But I can't find this file
"Advanced_DSL_Content.asp"
is this a file you discarded on the beta ?
thanks.

PS I have the 354.27
 
Hi RMerlin,
thanks for the post, I got all the asp files on my working PC to see what I can do to fix the switch for the 2 wan you implemented on the previous fw 270 dw .
But I can't find this file
"Advanced_DSL_Content.asp"
is this a file you discarded on the beta ?
thanks.

PS I have the 354.27

That page is only available if the router is also a DSL modem, such as the DSL-N55U.
 
Thanks !
;)
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top