mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix omr-6in4 init
This commit is contained in:
parent
fe39ad4d90
commit
e11e60bc5d
1 changed files with 4 additions and 2 deletions
|
@ -9,8 +9,10 @@ service_triggers() {
|
|||
}
|
||||
|
||||
reload_service() {
|
||||
addr=$(ifstatus glorytun | jsonfilter -e '@["ipv4-address"][0].address')
|
||||
peer=$(ifstatus glorytun | jsonfilter -e '@["route"][0].nexthop')
|
||||
iface=$(uci -q get glorytun.vpn.dev)
|
||||
[ -z "$iface" ] && exit 0
|
||||
addr=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
||||
peer=$(ip -4 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n")
|
||||
if [ "$addr" != "$(uci -q get network.omr6in4.ipaddr)" ] || [ "$peer" != "$(uci -q get network.omr6in4.peeraddr)" ]; then
|
||||
uci -q batch <<-EOF
|
||||
set network.omr6in4.ipaddr=$addr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue