What's new
  • 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!

Tutorial [Scripts][2025-12-01] SSD TRIM, IPSet-based Firewall & Tunnel Director, IPv6 Enhancements, WG Port Forwarder, and more

Hello. I copied the repo to my jffs folder and then made the files executable. But when I run sls
I get:

Code:
: not foundscripts/sdn/sdn_v6_shared.sh: line 2:
: not foundscripts/sdn/sdn_v6_shared.sh: line 10:
-sh: /jffs/scripts/sdn/sdn_v6_shared.sh: line 48: syntax error: unexpected word (expecting "do")

May I know where I am going wrong? Thanks.

I am only interested in IPv6 SLAAC and RA support for SDN networks currently. Thanks

Trying on Asus GT-AX6000 on 3006.102.6
 
Hello. I copied the repo to my jffs folder and then made the files executable. But when I run sls
I get:

Code:
: not foundscripts/sdn/sdn_v6_shared.sh: line 2:
: not foundscripts/sdn/sdn_v6_shared.sh: line 10:
-sh: /jffs/scripts/sdn/sdn_v6_shared.sh: line 48: syntax error: unexpected word (expecting "do")

May I know where I am going wrong? Thanks.

I am only interested in IPv6 SLAAC and RA support for SDN networks currently. Thanks

Trying on Asus GT-AX6000 on 3006.102.6
It looks like a similar issue to the one @Milan encountered in this thread. Are you using a Windows tool like WinSCP to upload the files? It can mess up line endings. If so, could you change the transfer mode to binary (or a similar option) and reupload the files?

Generally, you only need the files explicitly listed in the SDN section: everything in /jffs/scripts/sdn, dhcpc-event + dnsmasq-sdn.postconf + firewall-start in /jffs/scripts, and profile.add in /jffs/configs. Everything else is not needed.
 
It looks like a similar issue to the one @Milan encountered in this thread. Are you using a Windows tool like WinSCP to upload the files? It can mess up line endings. If so, could you change the transfer mode to binary (or a similar option) and reupload the files?

Generally, you only need the files explicitly listed in the SDN section: everything in /jffs/scripts/sdn, dhcpc-event + dnsmasq-sdn.postconf + firewall-start in /jffs/scripts, and profile.add in /jffs/configs. Everything else is not needed.
I used the scp which comes with windows now, I think its a part of OpenSSH. I will try to upload from a wsl distro and see if that is any better. Thanks.
 
Maybe when I’m brave enough to tinker with a non-critical router not affected by WAF…
So, I plucked up the courage to try this and wrote down my simplified steps for other folks wanting just SSD Trim but daunted by the process. Assumes you have SSH access to your Router (I use Putty) and can make Dirs and Transfer files (I use WinSCP)

Simplified how to (assuming using WinSCP for file transfers) for SSD Trim ONLY:
  • Create new directory “ssd” on router under /jffs/scripts/ i.e. /jffs/scripts/ssd
  • Create new directory “utils” on router under /jffs/scripts/ i.e. /jffs/scripts/utils
  • If asked by WinSCP, give these dirs 0644 permissions, which I think is the default anwyay
  • Download the currently two files config.sh and ssd_trim.sh from the link on kuchovsky GitHub (see links below) to desktop Note: to download them without each being turned into html, do NOT right click save as, but rather click the file, then select download "raw" file
  • Absolutely not necessary, but if you want to be neat, put them both in a local dir /jffs/scripts/ssd
  • Similarly, download the common.sh file to your desktop. Again. not necessary, but if you want to be neat, put it in a local dir /jffs/scripts/utils
  • WinSCP these three "raw" files from your desktop to the respective newly created dirs on the router i.e. config.sh and ssd_trim.sh -> /jffs/scripts/ssd and common.sh -> /jffs/scripts/utils
  • That's it for the manual "install"
Running:
  • To run once manually, ssh into your router, go to jffs/scripts/ssd (cd jffs/scripts/ssd) and run sh ssd_trim.sh. All going well (which it did on my two network systems) it should find your SSD and do the trim. It did not take long
  • Separately, to set up a cron (scheduled) job for this, append these lines to your exoisting services-start file in /jffs/scripts/

# --------------------- Trim SSD Cron Job - ref Kuchovsky ------------------
# trim_ssd - run every Sunday 04:00, sends fstrim to USB SSDs
cru a trim_ssd "0 4 * * 0 /jffs/scripts/ssd/ssd_trim.sh"

Refs: Links to files on GitHub

https://github.com/kuchkovsky/asuswrt-merlin-scripts/tree/main/jffs/scripts/ssd
https://github.com/kuchkovsky/asuswrt-merlin-scripts/blob/main/jffs/scripts/ssd/config.sh

https://github.com/kuchkovsky/asuswrt-merlin-scripts/blob/main/jffs/scripts/utils/common.sh

Many thanks to @kuchkovsky, this is simply fantastic!
RawFile.jpg
Dirs_Permissions.jpg
TrimDaTrim.jpg
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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