Ranger802004
Very Senior Member
Your link doesn't work for me, is it hosted somewhere like Russia or China? I am using Skynet for Geo blocking.Thank you very much. I created the link for 7 days.
Your link doesn't work for me, is it hosted somewhere like Russia or China? I am using Skynet for Geo blocking.Thank you very much. I created the link for 7 days.
I also use Skynet, but this is not a reason to isolate myself from the whole world)))Your link doesn't work for me, is it hosted somewhere like Russia or China? I am using Skynet for Geo blocking.
For me it's more for work purposes than personal reasons and I work from home.I also use Skynet, but this is not a reason to isolate myself from the whole world)))
Do you mind taking a look at my script and tell me what I am doing to delete the routes as you have suggested?It looks like AdGuard may be deleting the IP Rules or routes needed for failover to work? I’m not familiar with the tool but I do see where every time it goes back to WAN Status check it is having to recreate them and starts working again.
Nothing as far as routes that I can see but I do see where our scripts may be conflicting over resolv.conf file. Maybe we can collaborate to make them work together better?Do you mind taking a look at my script and tell me what I am doing to delete the routes as you have suggested?
Asuswrt-Merlin-AdGuardHome-Installer/AdGuardHome.sh at master · jumpsmm7/Asuswrt-Merlin-AdGuardHome-Installer
The Official Installer of AdGuardHome for Asuswrt-Merlin - jumpsmm7/Asuswrt-Merlin-AdGuardHome-Installergithub.com
From what I can tell you is, my script completely high jacks port 53. So instead of dnsmasq residing on port 53, Adguardhome does when adguardhome is running and dnsmasq is moved to port 553. This is all so adguardhome can directly identify the clients that use it. which would explain why he needs to stop adguardhome directly so your script will switch back to the primary wan.Nothing as far as routes that I can see but I do see where our scripts may be conflicting over resolv.conf file. Maybe we can collaborate to make them work together better?
Yes I'm aware, that's why I'm saying let's collaborate so we can resolve the conflict. I really just need some good indicators that AdGuard is active running to tell my script not to touch DNS / resolv.conf and that way your script continues to manage it.From what I can tell you is, my script completely high jacks port 53. So instead of dnsmasq residing on port 53, Adguardhome does when adguardhome is running and dnsmasq is moved to port 553. This is all so adguardhome can directly identify the clients that use it. which would explain why he needs to stop adguardhome directly so your script will switch back to the primary wan.
pidof adguardhomeYes I'm aware, that's why I'm saying let's collaborate so we can resolve the conflict. I really just need some good indicators that AdGuard is active running to tell my script not to touch DNS / resolv.conf and that way your script continues to manage it.
if [ -z "$(pidof AdGuardHome)" ] && [ ! -d "/opt/etc/AdGuardHome" ]; then service restart_dnsmasq; else service restart_AdGuardHome; fi
Yea I was coming up with a very similar command to yours while reading your code, I'm just going to tell it skip DNS "switching" if AdGuard is installed, dnsmasq restarts already during service restart function. Does AdGuard need to be restarted if WAN changes?pidof adguardhome
it generates a number.
a conditional argument like
if [ -z "$(pidof AdGuardHome)" ] && [ ! -d "/opt/etc/AdGuardHome" ]; then service restart_dnsmasq; else service restart_AdGuardHome; fi
this should resolve any issues.
Probably be best so it registers the appropriate interfaces, but tbh I am not too sure. I know sighup tells it to reconfigure all that stuff without actually restarting the service.Yea I was coming up with a very similar command to yours while reading your code, I'm just going to tell it skip DNS "switching" if AdGuard is installed, dnsmasq restarts already during service restart function. Does AdGuard need to be restarted if WAN changes?
It's no big deal to add it to the service restart if necessary.Probably be best so it registers the appropriate interfaces, but tbh I am not too sure. I know sighup tells it to reconfigure all that stuff without actually restarting the service.
it is covered by
service reload_AdGuardHome
/usr/sbin/curl -s "https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.5.5-beta.sh" -o "/jffs/scripts/wan-failover.sh" && chmod 755 /jffs/scripts/wan-failover.sh && sh /jffs/scripts/wan-failover.sh kill
/jffs/scripts/wan-failover.sh update
It works correctly and perfectly with AdGuardHome installed in AMTM and running as a service. Thank you so much for the work done.v1.5.5-beta Release:
Manually upgrade to this beta by running the following command" ***Allow for cronjob to relaunch the script***
Code:/usr/sbin/curl -s "https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.5.5-beta.sh" -o "/jffs/scripts/wan-failover.sh" && chmod 755 /jffs/scripts/wan-failover.sh && sh /jffs/scripts/wan-failover.sh kill
To revert back to Production Release:
Code:/jffs/scripts/wan-failover.sh update
Release Notes:
v1.5.5-beta
- If AdGuard is running or AdGuard Local is enabled, Switch WAN function will not update the resolv.conf file. (Collaboration with SomeWhereOverTheRainBow)
- Optimized the way script loads configuration variables.
- Service restarts will dynamically check which services need to be restarted.
- Optimized Boot Delay Timer functionality and changed logging messages to clarify how the Boot Delay Timer effects the script startup.
- WAN Status will now check if a cable is unplugged.
- General optimization
/usr/sbin/curl -s "https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.5.5-beta3.sh" -o "/jffs/scripts/wan-failover.sh" && chmod 755 /jffs/scripts/wan-failover.sh && sh /jffs/scripts/wan-failover.sh kill
/jffs/scripts/wan-failover.sh update
/usr/sbin/curl -s "https://raw.githubusercontent.com/Ranger802004/asusmerlin/main/wan-failover_v1.5.5-beta5.sh" -o "/jffs/scripts/wan-failover.sh" && chmod 755 /jffs/scripts/wan-failover.sh && sh /jffs/scripts/wan-failover.sh kill
/jffs/scripts/wan-failover.sh update
Do me a favor! Send me the output of this commandI am still running 386.5_2, will this break the script on my system?
ip -V
After collaborating with @SomeWhereOverTheRainBow I'm going to adjust this logic and just make sure the system binaries are taking precedence over optional binaries installed by like Entware. So I'm going to make some tweaks and publish another beta.ip utility, iproute2-5.11.0
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!