Merge pull request #5904 from TDT-AG/pr/20180412-mwna3-fix-ubus
mwan3: in ubus rpcd script fix shell local issue
This commit is contained in:
commit
86b2607d95
2 changed files with 59 additions and 54 deletions
|
@ -8,7 +8,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=mwan3
|
PKG_NAME:=mwan3
|
||||||
PKG_VERSION:=2.6.13
|
PKG_VERSION:=2.6.14
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
|
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
|
||||||
PKG_LICENSE:=GPLv2
|
PKG_LICENSE:=GPLv2
|
||||||
|
|
|
@ -74,60 +74,65 @@ get_mwan3_status() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
main () {
|
||||||
list)
|
|
||||||
json_init
|
|
||||||
json_add_object "status"
|
|
||||||
json_add_string "section" "x"
|
|
||||||
json_add_string "interface" "x"
|
|
||||||
json_close_object
|
|
||||||
json_dump
|
|
||||||
;;
|
|
||||||
call)
|
|
||||||
case "$2" in
|
|
||||||
status)
|
|
||||||
local section iface
|
|
||||||
read input;
|
|
||||||
json_load "$input"
|
|
||||||
json_get_var section section
|
|
||||||
json_get_var iface interface
|
|
||||||
|
|
||||||
config_load mwan3
|
case "$1" in
|
||||||
|
list)
|
||||||
json_init
|
json_init
|
||||||
case "$section" in
|
json_add_object "status"
|
||||||
interfaces)
|
json_add_string "section" "x"
|
||||||
json_add_object interfaces
|
json_add_string "interface" "x"
|
||||||
config_foreach get_mwan3_status interface "${iface}"
|
json_close_object
|
||||||
json_close_object
|
|
||||||
;;
|
|
||||||
connected)
|
|
||||||
json_add_object connected
|
|
||||||
json_add_array ipv4
|
|
||||||
report_connected_v4
|
|
||||||
json_close_array
|
|
||||||
json_add_array ipv6
|
|
||||||
report_connected_v6
|
|
||||||
json_close_array
|
|
||||||
json_close_object
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# interfaces
|
|
||||||
json_add_object interfaces
|
|
||||||
config_foreach get_mwan3_status interface
|
|
||||||
json_close_object
|
|
||||||
# connected
|
|
||||||
json_add_object connected
|
|
||||||
json_add_array ipv4
|
|
||||||
report_connected_v4
|
|
||||||
json_close_array
|
|
||||||
json_add_array ipv6
|
|
||||||
report_connected_v6
|
|
||||||
json_close_array
|
|
||||||
json_close_object
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
json_dump
|
json_dump
|
||||||
;;
|
;;
|
||||||
esac
|
call)
|
||||||
;;
|
case "$2" in
|
||||||
esac
|
status)
|
||||||
|
local section iface
|
||||||
|
read input;
|
||||||
|
json_load "$input"
|
||||||
|
json_get_var section section
|
||||||
|
json_get_var iface interface
|
||||||
|
|
||||||
|
config_load mwan3
|
||||||
|
json_init
|
||||||
|
case "$section" in
|
||||||
|
interfaces)
|
||||||
|
json_add_object interfaces
|
||||||
|
config_foreach get_mwan3_status interface "${iface}"
|
||||||
|
json_close_object
|
||||||
|
;;
|
||||||
|
connected)
|
||||||
|
json_add_object connected
|
||||||
|
json_add_array ipv4
|
||||||
|
report_connected_v4
|
||||||
|
json_close_array
|
||||||
|
json_add_array ipv6
|
||||||
|
report_connected_v6
|
||||||
|
json_close_array
|
||||||
|
json_close_object
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# interfaces
|
||||||
|
json_add_object interfaces
|
||||||
|
config_foreach get_mwan3_status interface
|
||||||
|
json_close_object
|
||||||
|
# connected
|
||||||
|
json_add_object connected
|
||||||
|
json_add_array ipv4
|
||||||
|
report_connected_v4
|
||||||
|
json_close_array
|
||||||
|
json_add_array ipv6
|
||||||
|
report_connected_v6
|
||||||
|
json_close_array
|
||||||
|
json_close_object
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
json_dump
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
|
Loading…
Reference in a new issue