mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-03-09 15:50:00 +00:00
Fix LAN default route, fix https://github.com/Ysurac/openmptcprouter-vps/pull/47 in an other way
This commit is contained in:
parent
454046f830
commit
9a764d0eaf
1 changed files with 1 additions and 1 deletions
|
@ -52,7 +52,7 @@ _lan_route() {
|
||||||
while IFS=$"\n" read -r c; do
|
while IFS=$"\n" read -r c; do
|
||||||
vpnremoteip=$(echo "$c" | jq -r '.vpnremoteip')
|
vpnremoteip=$(echo "$c" | jq -r '.vpnremoteip')
|
||||||
if [ -n "$vpnremoteip" ] && [ "$vpnremoteip" != "null" ]; then
|
if [ -n "$vpnremoteip" ] && [ "$vpnremoteip" != "null" ]; then
|
||||||
echo "$c" | jq -c '.lanips //empty' |
|
echo "$c" | jq -c '.lanips[] //empty' |
|
||||||
while IFS=$"\n" read -r d; do
|
while IFS=$"\n" read -r d; do
|
||||||
network=$(ipcalc -n $d | grep Network | awk '{print $2}')
|
network=$(ipcalc -n $d | grep Network | awk '{print $2}')
|
||||||
[ -n "$network" ] && [ -z "$(ip r show $network via $vpnremoteip)" ] && ip r replace $network via $vpnremoteip 2>&1 >/dev/null
|
[ -n "$network" ] && [ -z "$(ip r show $network via $vpnremoteip)" ] && ip r replace $network via $vpnremoteip 2>&1 >/dev/null
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue