diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-06-07 14:55:26 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-06-07 14:55:26 +0000 |
commit | 9869b4da3cf0c9e9347515488c73d54fb697b374 (patch) | |
tree | 51b2ac10d1ff937d670219f74892ddc865aca0bd /package/base-files/files/lib | |
parent | 5d50acec9dd36382ce0268f9a9ce4f1020ed32b4 (diff) | |
download | mtk-20170518-9869b4da3cf0c9e9347515488c73d54fb697b374.zip mtk-20170518-9869b4da3cf0c9e9347515488c73d54fb697b374.tar.gz mtk-20170518-9869b4da3cf0c9e9347515488c73d54fb697b374.tar.bz2 |
base-files: implement network_defer_device() and network_ready_device() wrappers for upcoming netifd iface deferring support
SVN-Revision: 32106
Diffstat (limited to 'package/base-files/files/lib')
-rw-r--r-- | package/base-files/files/lib/functions/network.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh index 684ba63..8b06e8c 100644 --- a/package/base-files/files/lib/functions/network.sh +++ b/package/base-files/files/lib/functions/network.sh @@ -62,3 +62,19 @@ network_is_up() network_get_device() { __network_device "$1" "$2" l3_device; } network_get_physdev() { __network_device "$1" "$2" device; } + + +__network_defer() +{ + local __device="$1" + local __defer="$2" + + json_init + json_add_string name "$__device" + json_add_boolean defer "$__defer" + + ubus call network.device set_state "$(json_dump)" 2>/dev/null +} + +network_defer_device() { __network_defer "$1" 1; } +network_ready_device() { __network_defer "$1" 0; } |