octopus
Part of the Furniture
Need som help/suggestions to get this working.
I use this script to monitor endpoint vpn-ipnumber.
I have two vpn-clients running, 1 and 3 and depending how it starts up I get display 1/ 2 in defferent order.
Also is doesn't matter if I use ovpnc1 or 3 I get same result in both way.
I wan't to use vpnclient-1 always been used/displayed.
Have someone any brilliant sulution?
I use this script to monitor endpoint vpn-ipnumber.
I have two vpn-clients running, 1 and 3 and depending how it starts up I get display 1/ 2 in defferent order.
Also is doesn't matter if I use ovpnc1 or 3 I get same result in both way.
I wan't to use vpnclient-1 always been used/displayed.
Have someone any brilliant sulution?
Code:
cantshow1="Can't show vpnroute-ip 1"
cantshow2="Can't show vpnroute-ip 2"
display=$(ip route show table ovpnc1 | grep "via $(nvram get wan0_gateway)" | awk -F' ' '{print $1}')
display1=$(echo $display | cut -d' ' -f2)
if [ -z "$display1" ]; then
display1=$cantshow1
fi
echo $display1
display2=$(echo $display | cut -c 1-14)
if [ -z "$display2" ]; then
display2=$cantshow2
fi
echo $display2
Code:
octopus@RT-AC68U:/tmp/home/root# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
193.187.91.199 gw11.A444.priv. 255.255.255.255 UGH 0 0 0 eth0
158.xxx.xxx.1 * 255.255.255.255 UH 0 0 0 eth0
217.64.148.49 gw11.A444.priv. 255.255.255.255 UGH 0 0 0 eth0
10.8.30.0 * 255.255.255.0 U 0 0 0 tun22
192.168.12.0 * 255.255.255.0 U 0 0 0 br0
158.xxx.xxx.0 * 255.255.252.0 U 0 0 0 eth0
10.128.0.0 * 255.255.0.0 U 0 0 0 tun11
10.129.0.0 * 255.255.0.0 U 0 0 0 tun13
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default gw11.A444.priv. 0.0.0.0 UG 0 0 0 eth0
Last edited: