aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/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
commitbff890af67b37a3f25cb19162f328d473bfac814 (patch)
tree9731802ceea17a06da964102abfdb78260363681 /package/base-files/files
parent86539b2a92811d818f4402e4dfb3c5ba5faa42aa (diff)
downloadupstream-bff890af67b37a3f25cb19162f328d473bfac814.tar.gz
upstream-bff890af67b37a3f25cb19162f328d473bfac814.tar.bz2
upstream-bff890af67b37a3f25cb19162f328d473bfac814.zip
[package] base-files: add network_is_up()
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31978 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/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 e038c94e1c..684ba63570 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; }