Maverickcdn
Senior Member
WICENS - WAN IP Change Email Notification Script v1.00 Jan2021 v.1.13 Sep 24,2021 v2.0 Oct 16,2021 v2.20 Oct 19,2021
v2.41 Nov 4,2021 v2.50 Nov 6,2021 v2.66 Jan 4,2022 v2.70 Feb 13,2022 v2.80 Jun 8,2022 v2.85 Jun 26 2022 v3.00 Sep 16 2022 Oct 27 2022 v3.10 Apr 6 2023 v3.20 Apr 10 2023 v3.30 Apr 15 2023 v3.40
This script is targeted at those that do not use a DDNS service but need to know if their WAN IP changes (ie. you run a VPN server etc) or you just want to know if and when your WAN IP has changed.
Open to any/all criticism/feedback so please let me know what you think.
- WAN IP update notifications (1-4 variable intervals)
- Historical WAN IPs w/observed lease times
- Firmware update notification
- Email Forwarder ability
- AMTM Email settings sync
- GMail, Outlook, Hotmail etc
- works in Double NAT
- Supports only IPv4
v3.20 fixes the from Email address in the Email header, you can alias your Email from address if your Email server allows
NOTE: when upgrading to 3.20 from a pre-existing install you should edit option 6 in the editor to match your login address if you do not plan to alias, some servers may reject the message.
Default install will now auto populate to match on install but can be changed for alias.
If amtm sync is enabled it will sync with From Address
As ALWAYS test the script after upgrading
v3.10 adds Forwarding capability, AMTM settings import w/sync and other tidbits
Version 3 brings another re-write of the script, additions, and overall optimizations
v3.00 has limited testing so please advise of issues and I will look to resolve as time allows (life is currently hectic)
- Script requires being configured with your To/From Email address(es), server address/port etc. or can sync with your amtm email config
Fw must be 384.15 or newer, or on Johns fork 374.43_48D3j9527 or newer
To install, scripts/ssh must be enabled. Install from AMTM main menu or from an SSH terminal, copy/paste
For first run, use the following to access the Menu.
Then select option 1 to create the config
After first run, you should be able to access the menu by simply entering
Use option b to create a backup of your configured settings if ever formatting /jffs or reinstalling wicens. Saved to script directory /jffs/addons/wicens
Use option s to call your own script when the WAN IP changes.
In SMTP server send config type, option 4 (SMTP Plain auth) is still untested.
Please visit the Github for more information, or install the script and use option a to view the readme/about page.
Hope people can find this script useful, and would welcome your feedback, there's already 3 user requested custom fields. I find scripting a nice escape from everyday life.
To truly test the script (built in test only tests Email function), use nano to edit the saved_wan_ip to something different (not blank) in /jffs/addons/wicens/wicens_user_config.wic and let it run with cron (or manual run through menu). Those taking advantage of the custom script calling function should certainly test it this way. Just note if you have eg. 2 email notifications set 1 day apart the script will sleep and will be locked that entire time till all are sent, to test I suggest setting just 1 notification and changing settings after testing if you require more than one notification
Feeling generous?
v2.41 Nov 4,2021 v2.50 Nov 6,2021 v2.66 Jan 4,2022
This script is targeted at those that do not use a DDNS service but need to know if their WAN IP changes (ie. you run a VPN server etc) or you just want to know if and when your WAN IP has changed.
Open to any/all criticism/feedback so please let me know what you think.
- WAN IP update notifications (1-4 variable intervals)
- Historical WAN IPs w/observed lease times
- Firmware update notification
- Email Forwarder ability
- AMTM Email settings sync
- GMail, Outlook, Hotmail etc
- works in Double NAT
- Supports only IPv4
v3.20 fixes the from Email address in the Email header, you can alias your Email from address if your Email server allows
NOTE: when upgrading to 3.20 from a pre-existing install you should edit option 6 in the editor to match your login address if you do not plan to alias, some servers may reject the message.
Default install will now auto populate to match on install but can be changed for alias.
If amtm sync is enabled it will sync with From Address
As ALWAYS test the script after upgrading
v3.10 adds Forwarding capability, AMTM settings import w/sync and other tidbits
Version 3 brings another re-write of the script, additions, and overall optimizations
v3.00 has limited testing so please advise of issues and I will look to resolve as time allows (life is currently hectic)
- Script requires being configured with your To/From Email address(es), server address/port etc. or can sync with your amtm email config
Fw must be 384.15 or newer, or on Johns fork 374.43_48D3j9527 or newer
To install, scripts/ssh must be enabled. Install from AMTM main menu or from an SSH terminal, copy/paste
Code:
curl --retry 3 "https://raw.githubusercontent.com/maverickcdn/wicens/master/wicens.sh" -o "/jffs/scripts/wicens.sh" && chmod a+rx "/jffs/scripts/wicens.sh"
For first run, use the following to access the Menu.
Code:
sh /jffs/scripts/wicens.sh
After first run, you should be able to access the menu by simply entering
Code:
wicens
Use option b to create a backup of your configured settings if ever formatting /jffs or reinstalling wicens. Saved to script directory /jffs/addons/wicens
Use option s to call your own script when the WAN IP changes.
In SMTP server send config type, option 4 (SMTP Plain auth) is still untested.
Please visit the Github for more information, or install the script and use option a to view the readme/about page.
Hope people can find this script useful, and would welcome your feedback, there's already 3 user requested custom fields. I find scripting a nice escape from everyday life.
To truly test the script (built in test only tests Email function), use nano to edit the saved_wan_ip to something different (not blank) in /jffs/addons/wicens/wicens_user_config.wic and let it run with cron (or manual run through menu). Those taking advantage of the custom script calling function should certainly test it this way. Just note if you have eg. 2 email notifications set 1 day apart the script will sleep and will be locked that entire time till all are sent, to test I suggest setting just 1 notification and changing settings after testing if you require more than one notification
Feeling generous?
Last edited: