What's new

[Fork] Asuswrt-Merlin 374.43 LTS releases (Archive)

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

How can I clean up this mess?
First thing I would try is to delete and reformat jffs (hopefully you have a backup from before the firmware load)...
On the MIPS based routers, jffs storage is made up of whatever flash is left over after the firmware is installed. Depending on how the allocations fall, as the firmware grows, it can overwrite the beginning of the jffs space.
 
Many thanks, that did the trick!
 
View attachment 23801 I have used john's build on my old rt-ac56u and wonder if this VPN-status page is displaying right?
Compared with RMerlin it should display more information.

Just tested some more and seems that when use client2 and policybase routing VPN - status working.
Not working when use point to point connection, otherwise everything work fine. (I have turned compress off)
@john9527 @ColinTaylor

vpn - client2.jpg
 
Last edited:
Hi all

First of all i do like to say thanks for this firmware and thread, i used it several times and it helping me.

Can anybody help me with my situation? Hope i don't mismatched thread for such question...
I have ASUS RT-N66 with Merlin LTS Fork 374.43_43E6j9527 firmware installed
I want set up script that will be email me in this case occurs:
wan-connected
I think its a good idea to know when WAN is down, to not constantly refreshing random pages sitting in front of the screen)

I read wiki (https://github.com/RMerl/asuswrt-merlin.ng/wiki) and take wan-start script example to test if i can set up it to work. Fill it with my credentials, connect through SSH to my router, put script in jffs/scripts/, make it executable and run it manually – all good, i got the email.
But, then i reboot my router – got nothing...

My questions is:
How to understand, that LTS firmware supports these scripts from wiki?
(https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts)

How can i set up script for my purposes? Do i need to update and go away from LTS fork to get it work?
(i read what wan-start script is deprecated now and we should use wan-event instead, but i really don't get how to do this, do i need write these wan-event conditions in the name of the script file, or in beginning of script code... Which WAN port i'm using primary (0) or secondary (1)... Can't find example of code to adapt it for me)
 
Last edited:
(i read what wan-start script is deprecated now and we should use wan-event instead, but i really don't get how to do this, do i need write these wan-event conditions in the name of the script file, or in beginning of script code... Which WAN port i'm using primary (0) or secondary (1)... Can't find example of code to adapt it for me)
This would be an example of wan-event to know when primary WAN is disconnected.
Code:
#!/bin/sh

if [ "$1" = "0" ] && [ "$2" = "disconnected" ]; then
  # run your commands here when wan0 is disconnected
fi
 
Last edited:
@dave14305

Thanks! Do i need filename this script "wan-event" or i can use my own name?
I just don't know how the system determites which script should run, by the name of the file, or it reads every script code in folder...
What if i want to separate wan-event script for several script files with multiple events? All this files must be with same name "wan-event"?
 
@dave14305

Thanks! Do i need filename this script "wan-event" or i can use my own name?
I just don't know how the system determites which script should run, by the name of the file, or it reads every script code in folder...
What if i want to separate wan-event script for several script files with multiple events? All this files must be with same name "wan-event"?
The script filename must be /jffs/scripts/wan-event

Firmware will call that script once for each WAN event it receives. If you want to handle different events (e.g. connected, stopping) you would just add else conditions (plus I fixed my && condition)
Code:
#!/bin/sh

if [ "$1" = "0" ] && [ "$2" = "disconnected" ]; then
  # run your commands here when wan0 is disconnected
elif [ "$2" = "connected" ]; then
  # more stuff if ANY WAN connected
elif [ "$2" = "stopping" ]; then
  # more stuff if ANY WAN stopping
fi
Firmware will run wan-event, and then it will still run wan-start if it exists, so you don't want wan-start anymore if you use wan-event. wan-start commands can be put the "connected" part of the script above.
 
Last edited:
dave14305
Thanks Dave, i got the main idea
But then i try run it manually for test it says:
Code:
/jffs/scripts# ./wan-event.sh
[: missing ]

if i put script in configs folder, it says:
Code:
/jffs/configs# ./wan-event-v2.sh
sendmail: can't connect to remote host (127.0.0.1): Connection refused

This is my script:
Code:
#!/bin/sh
if [ "$1" = "0" && "$2" = "connected" ]; then
FROM="my email address"
AUTH="my login"
PASS="my password"
FROMNAME="Your Router"
TO="my email"

echo "Subject: WAN state notification" >/tmp/mail.txt
echo "From: \\"$FROMNAME\\"<$FROM>" >>/tmp/mail.txt
echo "Date: $(date -R)" >>/tmp/mail.txt
echo "" >>/tmp/mail.txt
echo "I just got connected to the internet." >>/tmp/mail.txt
echo "" >>/tmp/mail.txt

cat /tmp/mail.txt | sendmail "exec openssl s_client -quiet \
-CAfile /tmp/Equifax_Secure_Certificate_Authority.pem \
-connect smtp.gmail.com:587 -tls1 -starttls smtp" \
-f"$FROM" \
-xu"$AUTH" -xp"$PASS" $TO

rm /tmp/mail.txt
fi

Maybe when i run it manually, the system thinks what there are no "connected" event happen so no result?
Also, wiki says
the list can vary between firmware versions

P.S. ColinTaylor Thanks, also noticed this
 
@Meshkoff what is in wan-event.sh? You would not run the script manually. The firmware would invoke the script directly. Is wan-event.sh different than /jffs/scripts/wan-event?
 
dave14305
ColinTaylor
.sh extension is just for correct filenaming)
I though it will work too, but ok, i renamed

I reboot router and still nothing happens

Maybe i just need to update firmware?
Read changelog here: https://www.asuswrt-merlin.net/changelog-382
wan-event is surely supported on the fork. See Changelog: https://github.com/john9527/asuswrt-merlin/blob/374.43_2-update/Changelog.txt#L258

Run your script once like this:
Code:
chmod +x /jffs/scripts/wan-event
dos2unix /jffs/scripts/wan-event
sh -x /jffs/scripts/wan-event 0 disconnected
Remove your personal email/pw from the output and post the results.
 
wan-event is surely supported on the fork.
Good to hear

No need to remove personal info because it says:
Code:
+ [ 0 = 0 ]
+ [ disconnected = connected ]

Ran it one more time, line by line, same result
 
dave14305
Whole evolution is result of many errors)

Now it says:

Code:
+ [ 0 = 0 ]
+ [ connected = connected ]
+ FROM=my email
+ AUTH=my login
+ PASS=my pass
+ FROMNAME=Your Router
+ TO=my email
+ echo Subject: WAN state notification
+ echo From: \Your Router\<my email>
+ date -R
+ echo Date: Fri, 05 Jun 2020 21:08:14 +0300
+ echo
+ echo I just got connected to the internet.
+ echo
+ cat /tmp/mail.txt
+ sendmail exec openssl s_client -quiet -CAfile /tmp/Equifax_Secure_Certificate_Authority.pem -connect smtp.gmail.com:587 -tls1 -starttls smtp -fmyemail -aumylogin -apmypass myemail
sendmail: can't connect to remote host (127.0.0.1): Connection refused
+ rm /tmp/mail.txt

sendmail: can't connect to remote host (127.0.0.1): Connection refused
 

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