From: Jo-Philipp Wich Date: Tue, 29 May 2012 02:03:25 +0000 (+0000) Subject: [package] base-files: add network_is_up() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d606f9abf1a57399db6153539c54f8b09c58fbef;p=openwrt%2Fsvn-archive%2Farchive.git [package] base-files: add network_is_up() SVN-Revision: 31978 --- 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; }