base-files: add network_get_metric() to /lib/functions/network.sh
[openwrt/openwrt.git] / package / base-files / files / lib / functions / network.sh
index d7fd2dea57308721425f89d4b8c38c7b8f1ccc70..4fdcb66302a1e6588fb8d7bd6f0d3be322261c99 100644 (file)
@@ -271,6 +271,11 @@ network_is_up()
 # 2: interface
 network_get_protocol() { __network_ifstatus "$1" "$2" ".proto"; }
 
+# determine the metric of the given logical interface
+# 1: destination variable
+# 2: interface
+network_get_metric() { __network_ifstatus "$1" "$2" ".metric"; }
+
 # determine the layer 3 linux network device of the given logical interface
 # 1: destination variable
 # 2: interface