mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-03-09 15:50:00 +00:00
bug fix in the _lan_route procedure
The procedure has an error whilst trying to pickup the subnets from the omr-admin-config.json therefore everytime the procedure starts it was creating the same route to 192.168.1.1 regardless of what data was taken from the config file. I added a sed command to clean the variable from the original value ["192.168.3.1/255.255.255.0"] -to the correct value accepted by the command ipcalc -n 92.168.3.1/255.255.255.0
This commit is contained in:
parent
454046f830
commit
60066cbf8f
1 changed files with 2 additions and 1 deletions
|
@ -54,7 +54,8 @@ _lan_route() {
|
|||
if [ -n "$vpnremoteip" ] && [ "$vpnremoteip" != "null" ]; then
|
||||
echo "$c" | jq -c '.lanips //empty' |
|
||||
while IFS=$"\n" read -r d; do
|
||||
network=$(ipcalc -n $d | grep Network | awk '{print $2}')
|
||||
subnet=$(sed 's/\[//g; s/\]//g; s/"//g' <<< $d)
|
||||
network=$(ipcalc -n $subnet | grep Network | awk '{print $2}')
|
||||
[ -n "$network" ] && [ -z "$(ip r show $network via $vpnremoteip)" ] && ip r replace $network via $vpnremoteip 2>&1 >/dev/null
|
||||
done
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue