mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-03-09 15:50:00 +00:00
Update API and fix omr-service script
This commit is contained in:
parent
129e6a9ae4
commit
c11d4737e5
2 changed files with 11 additions and 9 deletions
18
omr-service
18
omr-service
|
@ -53,14 +53,16 @@ _lan_route() {
|
|||
_gre_tunnels() {
|
||||
. "$(readlink -f "/etc/shorewall/params.vpn")"
|
||||
for intf in /etc/openmptcprouter-vps-admin/intf/*; do
|
||||
. "$(readlink -f "$intf")"
|
||||
iface="$(basename $intf)"
|
||||
if [ "$(ip tunnel show $iface 2>/dev/null | awk '{print $4}')" != "$OMR_ADDR" ]; then
|
||||
ip tunnel del $iface 2>&1 >/dev/null
|
||||
ip tunnel add $iface mode gre local $INTFADDR remote $OMR_ADDR
|
||||
ip link set $iface up
|
||||
ip addr add $LOCALIP dev $iface
|
||||
ip route add $NETWORK dev $iface 2>&1 >/dev/null
|
||||
if [ -f "$intf" ]; then
|
||||
. "$(readlink -f "$intf")"
|
||||
iface="$(basename $intf)"
|
||||
if [ "$(ip tunnel show $iface 2>/dev/null | awk '{print $4}')" != "$OMR_ADDR" ]; then
|
||||
ip tunnel del $iface 2>&1 >/dev/null
|
||||
ip tunnel add $iface mode gre local $INTFADDR remote $OMR_ADDR
|
||||
ip link set $iface up
|
||||
ip addr add $LOCALIP dev $iface
|
||||
ip route add $NETWORK dev $iface 2>&1 >/dev/null
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue