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)
committerHans Dedecker <dedeckeh@gmail.com>
Sat, 29 Jun 2019 19:00:58 +0000 (21:00 +0200)
Add missing ubus api call for uptime value.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
package/base-files/Makefile
package/base-files/files/lib/functions/network.sh

index 7129d488dbee9d45c697dc24c3bcc7f98214eead..e2794f9cedab14a37e4381b75d174733a178b04e 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