What's new

[WICENS] WAN IP Change Email Notification Script

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

I'm sorry, but I don't have time for that right now. I'll take a look at it on Thursday or give you direct access if you're interested..
 
Thanks, I had the path hardcoded to /bin for nvram lookups. Pushed a hotfix... please download and let me know. I may go back to removing all the hard coded paths if you encounter other errors
And now I did it. After using the command to remove the flood script, I installed version 3.0 and the gmail import from AMTM went without problems. Everything works...Great

However, I cannot test the transition from the previous version. If you are interested in this test, send me the previous version of the script and I can test the update..
 
Ill approach him when Im comfortable and if he's willing.... for now lets just make sure I didnt bork it, and works as it should.
I'll be ready to add WICENS to amtm whenever you are. Just make sure to change the import mail function to just include the files when present in amtm.
 
If you are interested in this test, send me the previous version of the script and I can test the update..
Code:
curl --retry 3 "https://raw.githubusercontent.com/maverickcdn/wicens/v2.85/wicens.sh" -o "/jffs/scripts/wicens.sh" && chmod a+rx "/jffs/scripts/wicens.sh"
Uninstall any pre-existing wicens script through the wicens menu and use this for the last version before 3.00

I'll be ready to add WICENS to amtm whenever you are. Just make sure to change the import mail function to just include the files when present in amtm.
Thanks, I decided with setting a flag AMTM is being used and just sync the configs every run and update if changes are detected, was easier to code with the time I have... Ill get it up soon hopefully
3.10 edit.PNG3.10 status.PNG
 
Hello,

First of all, thanks for this great work! I stumbled on this script through a random Google search, while trying to fine-tune my wan-event script (I'm not a scripter but I can create few liners). To my greatest surprise, this script works perfectly!!

However, I'd like to make a request. Is it possible to create an option to disable the cron job (for those that want to)? I only need the script for email notification when the wan IP changes and not through a cron job and thus, I only need it to run during a wan-event and not at intervals. Once again, I appreciate your great work. Many thanks.


Edit: In the meantime, I've edited the cru in my local script to '*/10 * * 9 *", which changes the cron job from every 10 minutes to every 10th minute in September. No complaints for a cron job that runs once a year :)
 
Last edited:
However, I'd like to make a request. Is it possible to create an option to disable the cron job (for those that want to)? I only need the script for email notification when the wan IP changes and not through a cron job and thus, I only need it to run during a wan-event and not at intervals. Once again, I appreciate your great work. Many thanks.
Sorry the script redundancies/features are too heavily dependent on cron.

Careful changing cron in this script, specifically regarding WAN IP change notifications, if the Email fails to send for whatever reason during the call from wan-event it relies on the cron calls to re-attempt sending the notification.
 
Sorry the script redundancies/features are too heavily dependent on cron.

Careful changing cron in this script, specifically regarding WAN IP change notifications, if the Email fails to send for whatever reason during the call from wan-event it relies on the cron calls to re-attempt sending the notification.
Thanks for the prompt reply sir. I understand what you mean with being careful with the cron. I rely on the system log a lot (addiction maybe) and the cron job is filling up the log with the default 10 minutes interval. My issue is that my custom smb.conf gets replaced with the default everytime the wan IP changes but I have resolved this in another wan-event script. For my use case, I can live with the wicens script getting triggered by just the wan-event. Even if I miss the email because of the less frequent cron, I will know from the logs anyway. However, I think its cool to be able to recieve an email anytime the wan IP changes. Keep up with the good works.
 
I rely on the system log a lot (addiction maybe) and the cron job is filling up the log with the default 10 minutes interval.
Are you saying wicens is spamming the log with cron runs? Can you share what the log message is so I can look into it?
 
Version 3.10 is up with amtm sync and a couple other minor script changes
 
goodevening, i found this script in the new Amtm 3.5, and try to use it.
but i cant send any test email by gmail account

i dont get a 2mfa message on my phone.

i tried every options with smtp

smtp.google.com:587
gmailadress
smtp_start_tls (option1)

do i forgot something ?

any help or example how to fill in would be appriciate

thx :)
 
Last edited:
goodevening, i found this script in the new Amtm 3.5, and try to use it.
but i cant send any test email by gmail account

i dont get a 2mfa message on my phone.

i tried every options with smtp

smtp.google.com
gmailadres
smtp_start_tls (option1)

do i forgot something ?

any help or example how to fill in would be appriciate

thx :)
You need to set up an app password if 2FA is enabled.
 
You need to set up an app password if 2FA is enabled.
i have a 2mfa app on my phone for google, and normally when i login with a other unknow pc on my gmailaccount i get a message for accept, but now i dont get any message for approve login
 
i have a 2mfa app on my phone for google, and normally when i login with a other unknow pc on my gmailaccount i get a message for accept, but now i dont get any message for approve login
Google App Password: "App passwords let you sign in to your Google Account from apps on devices that don't support 2-Step Verification."
 
When I try that link above, it tells me
Do you have 2FA enabled?

Google used to have a toggle to allow 'Less Secure App' access using only your Email/password. This has been removed for a year now and you are required to enable 2FA and use specific app passwords

Google App Passwords
 
There's something odd with importing the mail settings from amtm. It seems (at least one of the variables is imported incorrectly). I can send mail from everywhere using the settings in amtm, but not from WICENS and I think I found out why.

Every single test mail fails, stating

Code:
[FAIL] Current WAN IP is                : x.x.x.x Test Mode --- No Match
[ OK ] Internet check                   : 6 successful pings, appears up
[FAIL] Error, failed to send Email notification 1 of 1
[-##-] Are your Email settings in this script correct? and password?
[-##-] Or maybe your Email host server was temporarily down?

The error showing in the log is:

Code:
< 235 2.7.0 Authentication successful
} [5 bytes data]
> MAIL FROM:<AsusWRT-Merlin> SIZE=658 <----------------------
{ [5 bytes data]
< 550 5.7.0 From address is not one of your addresses <--------------------
* MAIL failed: 550
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
} [5 bytes data]
> QUIT
{ [5 bytes data]
< 221 2.0.0 Bye
* Closing connection 0
{ [5 bytes data]
* TLSv1.3 (IN), TLS alert, close notify (256):
{ [2 bytes data]
* TLSv1.3 (OUT), TLS alert, close notify (256):
} [2 bytes data]

However, sending a test mail from amtm shows no problem. I miss the mail address used to send mail from in the verbose output of WICENS, which is shown in amtm output. WICENS shows the routers' "Friendly Name" from amtm which is not a mail adddress. Amtm shows the correct e-mail address:

Code:
> MAIL FROM:<wouldntyouliketoknow@icloud.com> SIZE=284 <---------------------

I'm sending mail from an iCloud.com alias with an app-specific password. I've reset all settings, even the app specific password, but to no avail.

Can you please check this? Of course I can configure WICENS manually, but it would be preferable to keep things in sync with amtm.

Thanks in advance.

Best regards,
Marco
 
Can you please check this? Of course I can configure WICENS manually, but it would be preferable to keep things in sync with amtm.

Thanks in advance.

Best regards,
Marco
Yes we have one difference in our curl commands in --mail-from. After reading the man page I see I have it incorrect

I will update it to match amtm
 

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