If I understand this correctly, the /jffs/post-mount script would run every time a usb drive was inserted. I'm guessing that on a boot, if one or more usb drives were already connected, it would run for each? So for one-time changes, the script probably should use a lock file in /tmp/root (so it is cleared post reboot) or some other mechanism to prevent running again.I have started a swap file on a USB using a script in file: /jffs/post-mount You can put whatever you want in the script but it needs to begin with:
#!/bin/sh
and I would add a delay line next like:
sleep 5
To get it to work, in a terminal do:
nvram set script_usbmount="/jffs/post-mount"
nvram commit
When the router starts or you insert a USB drive the script will run.
Tried setting up a script in latest stock firmware (3.0.0.4.388_33506 / ASUS TUF-AX4200) and it doesn't seem to work anymore. I set the "script_usbmount" nvram parameter and I can see it for a short time afterwards (with nvram get...), but it's being overwritten and commit doesn't seem to work. Any ideas?
Thread starter | Title | Forum | Replies | Date |
---|---|---|---|---|
B | Clear, Delete, or Reset AiProtection's Alert Preference Information | ASUSWRT - Official | 3 | |
A | Run custom script on official ASUS firmware | ASUSWRT - Official | 10 |
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!