1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

add quiet options when jsonfilter is used

This commit is contained in:
Ycarus 2018-06-18 23:27:34 +02:00
parent eb9658bcb1
commit f6efdc51c9
6 changed files with 13 additions and 13 deletions

View file

@ -16,9 +16,9 @@ reload_service() {
elif [ "$(uci -q get openvpn.omr.enabled)" = "1" ]; then
iface=$(uci -q get openvpn.omr.dev)
fi
addr=$(ubus call network.interface.omrvpn status | jsonfilter -e '@["ipv4-address"][0].address' | tr -d "\n")
addr=$(ubus call network.interface.omrvpn status | jsonfilter -q -e '@["ipv4-address"][0].address' | tr -d "\n")
[ -z "$addr" ] && [ -n "$iface" ] && addr=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
peer=$(ubus call network.interface.omrvpn status | jsonfilter -e '@.route[0].nexthop' | tr -d "\n")
peer=$(ubus call network.interface.omrvpn status | jsonfilter -q -e '@.route[0].nexthop' | tr -d "\n")
[ -z "$peer" ] && [ -n "$iface" ] && peer=$(ip -4 r list dev $iface | grep kernel | awk '/proto kernel/ {print $1}' | grep -v / | tr -d "\n")
[ -z "$addr" ] && exit 0
[ -z "$peer" ] && exit 0