base-files: add network_get_uptime() to /lib/functions/network.sh
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 28 Jun 2019 10:59:19 +0000 (12:59 +0200)
committerRISCi_ATOM <bob@bobcall.me>
Fri, 13 Sep 2019 19:54:33 +0000 (15:54 -0400)
Add missing ubus api call for uptime value.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 9e780ed5f7b834e06ec5c82323731917aef4ee53)

package/base-files/Makefile
package/base-files/files/lib/functions/network.sh

index 74ea2df91ae0c4a90870b574c9320f4c9337416a..c84d2763c2ceccde7c6af520a6883c93dc7f22e7 100644 (file)
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=200
+PKG_RELEASE:=201
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
index 4fdcb66302a1e6588fb8d7bd6f0d3be322261c99..6b946b9f806b0b187d3c7c1f0325745f085c59c6 100644 (file)
@@ -271,6 +271,11 @@ network_is_up()
 # 2: interface
 network_get_protocol() { __network_ifstatus "$1" "$2" ".proto"; }
 
+# determine the uptime of the given logical interface
+# 1: destination variable
+# 2: interface
+network_get_uptime() { __network_ifstatus "$1" "$2" ".uptime"; }
+
 # determine the metric of the given logical interface
 # 1: destination variable
 # 2: interface