I'd like to modify an .asp file that is stored in the /www folder on the router (this one: /www/AiProtection_HomeProtection.asp) to fix a small UI bug.
This is for stock Asuswrt firmware.
Can I just go with ssh, use vi and edit the file to fix the bug? Would the change be persistent to next reboot if I do so?
What is the recommended way to change these files?
Jo S.
I have a shell script that I've used before to mount & unmount modified/customized versions of existing WebUI pages to try a few changes or test something new in their HTML/JavaScript code. If you want to try it with your fixed ASP file, I put a copy in
PasteBin so you can download it:
Bash:
curl -kLSs --retry 3 --retry-delay 5 --retry-connrefused pastebin.com/raw/B5Ca5ZX0 | tr -d '\r' > $HOME/SetUpModifiedWebUIpageTab.sh
chmod 755 $HOME/SetUpModifiedWebUIpageTab.sh
You should store the script somewhere in the
JFFS partition so it survives a reboot. I added some help messages to make it a bit user-friendly and show the available call parameters. I already modified 1 of the 2 customizable variables in the script required for your specific case. Now you'll need to modify only the "
MOD_WEBPAGE_DIR" variable with the directory location of your modified ASP file (see the "
CUSTOMIZABLE PARAMETERS SECTION" section near the top of the script).
As
@ColinTaylor stated, you need to make a copy of the original ASP file, modify it with your fix & store it on a JFFS subdirectory; then, you can use the "
SetUpModifiedWebUIpageTab.sh" script to easily mount & unmount the modified ASP file for testing & verifying your fixes/changes. Once you're happy that it's working as you expect, you can call the script from another script which is run on every reboot via the "
script_usbmount" NVRAM var.
Run the "
SetUpModifiedWebUIpageTab.sh" script from the directory where it's been stored without any parameters to get the help messages:
Bash:
./SetUpModifiedWebUIpageTab.sh
HTH