What's new

Creating a User Script for Swap On?

  • 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!

pjd50

Regular Contributor
Can anyone tell me how to create a user script? I tried to follow the wiki here (https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts) but without luck...

My goal is to have the swap file turn on anytime I reboot the router. I found instructions here:
https://mydevtutorials.wordpress.com/2014/01/10/how-to-activate-swap-on-asus-rt-ac68u-router/

If you reboot your router, the swap will be inactive until you swapon again. To do this automatically you have to create the file /jffs/scripts/post-mount, or edit it if exists and add the line:
1
2
#!/bin/sh
swapon /tmp/mnt/sda1/myswap.swp
Now every time the router reboots, it will turn on swap.

But when I try these commands in Putty, nothing works. I got as far turning the swap on --- but I can't figure out the correct set of commands to get the " /jffs/scripts/post-mount " to automatically turn swap on.

Can anyone help me? thank you!!
 
Can anyone tell me how to create a user script? I tried to follow the wiki here (https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts) but without luck...

My goal is to have the swap file turn on anytime I reboot the router. I found instructions here:
https://mydevtutorials.wordpress.com/2014/01/10/how-to-activate-swap-on-asus-rt-ac68u-router/



But when I try these commands in Putty, nothing works. I got as far turning the swap on --- but I can't figure out the correct set of commands to get the " /jffs/scripts/post-mount " to automatically turn swap on.

Can anyone help me? thank you!!
This is mine.
Code:
#!/bin/sh
swapon /tmp/mnt/<myUSB>/myswap.swp # Swap file created by amtm
It is done when I created the swap file using the AsusWrt Merlin Terminal Menu.
https://www.snbforums.com/threads/amtm-the-asuswrt-merlin-terminal-menu.42415/

It allows installing other useful scripts as well/
 

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