My wife is using internet.. When I can ill do a sh +x, and kill my primary line see if I can see something.WAN0TARGET="$(nvram get wan0_dns | awk '{print $1}')"
WAN1TARGET="$(nvram get wan1_gateway)"
My wife is using internet.. When I can ill do a sh +x, and kill my primary line see if I can see something.WAN0TARGET="$(nvram get wan0_dns | awk '{print $1}')"
WAN1TARGET="$(nvram get wan1_gateway)"
Send your script over and let me take a look, somewhere it is trying to grep but doesn’t have a parameter set like -e? Perhaps the script status check at the top?WAN0TARGET="$(nvram get wan0_dns | awk '{print $1}')"
WAN1TARGET="$(nvram get wan1_gateway)"
If you run diff, youll see nothings really been changed.Send your script over and let me take a look, somewhere it is trying to grep but doesn’t have a parameter set like -e? Perhaps the script status check at the top?
I’m not home atm, run diff and send me the output please.If you run diff, youll see nothings really been changed.
admin@RT-AX86U-D7D0:/jffs/scripts# diff original wan2I’m not home atm, run diff and send me the output please.
Did you change something with the ping count or timeout? Go ahead and run this command and send me the output.admin@RT-AX86U-D7D0:/jffs/scripts# diff original wan2
--- original
+++ wan2
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh
# Author: Ranger802004
# Version 1.1
@@ -32,7 +32,7 @@
DNSRESOLVFILE="/tmp/resolv.conf"
#Ping Target for failure detections, must be routed over targeted interface
-WAN0TARGET="$(nvram get wan0_dns1_x)"
+WAN0TARGET="$(nvram get wan0_dns | awk '{print $1}')"
WAN1TARGET="$(nvram get wan1_gateway)"
#Ping count before WAN is considered down, requires 100% Packet Loss.
@@ -45,11 +45,11 @@
#QoS Manual Settings Variables
#QoS Inbound Bandwidth - Values are in Kbps
-WAN0_QOS_IBW=972800
-WAN1_QOS_IBW=97280
+WAN0_QOS_IBW=2972800
+WAN1_QOS_IBW=2297280
#QoS Outbound Bandwidth - Values are in Kbps
-WAN0_QOS_OBW=972800
-WAN1_QOS_OBW=5120
+WAN0_QOS_OBW=22972800
+WAN1_QOS_OBW=225120
#QoS WAN Packet Overhead - Values are in Bytes
WAN0_QOS_OVERHEAD=42
WAN1_QOS_OVERHEAD=18
@@ -311,7 +311,7 @@
# Trigger WAN Event
wanevent ()
{
-/jffs/scripts/wan-event
+#/jffs/scripts/wan-event
wanstatus
}
scriptstatus
You need wan1_dns populated, most likely.I bet I have another blank nvram setting that needs changed on Wan1.
Shouldn’t unless he is targeting it for his ping target. The switch wan will check that variable and then go to dns1_x and dns2_x variables. Unless both of those are blank as well should be fine.You need wan1_dns populated, most likely.
@Ranger802004 and @dave14305 , right now I just have dual wan set in the UI, with nothing setup for ping,dns,etc while trying the script. Besides that ranger as you can see, i didnt change much at all in the script. I can give you the output of nvram if you tell me exactly what your looking for. wan1_dns points to the secondary modem ip right now. As does nvram get wan1_gatewayShouldn’t unless he is targeting it for his ping target. The switch wan will check that variable and then go to dns1_x and dns2_x variables. Unless both of those are blank as well should be fine.
I’m just looking for if any of the variables used throughout the script are blank.@Ranger802004 and @dave14305 , right now I just have dual wan set in the UI, with nothing setup for ping,dns,etc while trying the script. Besides that ranger as you can see, i didnt change much at all in the script. I can give you the output of nvram if you tell me exactly what your looking for. wan1_dns points to the secondary modem ip right now. As does nvram get wan1_gateway
@Ranger802004 and @dave14305 , right now I just have dual wan set in the UI, with nothing setup for ping,dns,etc while trying the script. Besides that ranger as you can see, i didnt change much at all in the script. I can give you the output of nvram if you tell me exactly what your looking for.
nvram show 2>/dev/null | grep -E "^wan[01]?_dns|^wan[01]?_ifname"
I only saw it when it switch to wan1, but I cannot test failover for now.I’m just trying to understand your grep problem.Code:nvram show 2>/dev/null | grep -E "^wan[01]?_dns|^wan[01]?_ifname"
I sent the diff, i didnt touch any of that.Did you change something with the ping count or timeout? Go ahead and run this command and send me the output.
nvram show | grep -e “wan”
I have a clue on the problem and can test and add some logic for it later, do this in the meantime and test, assign a second DNS server to your WAN1 interface and see if gets rid of the error.I only saw it when it switch to wan1, but I cannot test failover for now.
admin@RT-AX86U-D7D0:/jffs/scripts# nvram show 2>/dev/null | grep -E "^wan[01]?_dns|^wan[01]?_ifname"
wan0_dns=1.1.1.1 8.8.8.8
wan0_dns1_x=1.1.1.1
wan0_dns2_x=
wan0_dnsenable_x=1
wan0_ifname=eth0
wan1_dns=192.168.10.1
wan1_dns1_x=1.1.1.1
wan1_dns2_x=
wan1_dnsenable_x=1
wan1_ifname=eth5
wan_dns=192.168.10.1
wan_dns1_x=1.1.1.1
wan_dns2_x=
wan_dnsenable_x=1
wan_ifname=eth5
wan_ifnames=eth0 eth5
sorry but I assume, this will work for now?I have a clue on the problem and can test and add some logic for it later, do this in the meantime and test, assign a second DNS server to your WAN1 interface and see if gets rid of the error.
Yea should work as a temp fix until I can update the script this weekend.sorry but I assume, this will work for now?
admin@RT-AX86U-D7D0:/jffs/scripts# nvram set wan1_dns2_x=8.8.8.8
admin@RT-AX86U-D7D0:/jffs/scripts# nvram set wan0_dns2_x=8.8.8.8
There seems to be a misplaced/misused&
in the middle of theuntil
condition inswitchwan()
.
Yes, maybe it needs to be
&&
, but I haven’t tried too hard to decipher that line.That should be correct, the first 2 conditions are together with the { ;} brackets and the second is a command to run with a single &
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!