summaryrefslogtreecommitdiff
path: root/package/base-files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-05-29 02:03:25 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-05-29 02:03:25 +0000
commitc11151bc7083f75c4b2aca761ac62b924bc3b587 (patch)
tree0202cd7427342a96140cdf965c7f6250b91ed3e9 /package/base-files
parentc998280a7cda24ccf109c076b121640a0536df5e (diff)
downloadmtk-20170518-c11151bc7083f75c4b2aca761ac62b924bc3b587.zip
mtk-20170518-c11151bc7083f75c4b2aca761ac62b924bc3b587.tar.gz
mtk-20170518-c11151bc7083f75c4b2aca761ac62b924bc3b587.tar.bz2
base-files: add network_is_up()
SVN-Revision: 31978
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/files/lib/functions/network.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh
index e038c94..684ba63 100644
--- a/package/base-files/files/lib/functions/network.sh
+++ b/package/base-files/files/lib/functions/network.sh
@@ -54,5 +54,11 @@ __network_device()
json_get_var "$__var" "$__field"
}
+network_is_up()
+{
+ local __up
+ __network_device __up "$1" up && [ $__up -eq 1 ]
+}
+
network_get_device() { __network_device "$1" "$2" l3_device; }
network_get_physdev() { __network_device "$1" "$2" device; }