mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-03-09 15:50:00 +00:00
Update server script
This commit is contained in:
parent
e6d3bb7279
commit
a5cf11a449
2 changed files with 23 additions and 15 deletions
26
omr-service
26
omr-service
|
@ -60,19 +60,21 @@ _lan_route() {
|
|||
|
||||
_gre_tunnels() {
|
||||
. "$(readlink -f "/etc/shorewall/params.vpn")"
|
||||
for intf in /etc/openmptcprouter-vps-admin/intf/*; do
|
||||
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
|
||||
if [ -n "$OMR_ADDR" ]; then
|
||||
for intf in /etc/openmptcprouter-vps-admin/intf/*; do
|
||||
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 2>&1 >/dev/null
|
||||
ip link set $iface up 2>&1 >/dev/null
|
||||
ip addr add $LOCALIP dev $iface 2>&1 >/dev/null
|
||||
ip route add $NETWORK dev $iface 2>&1 >/dev/null
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
_openvpn_bonding() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue