]> git.ipfire.org Git - people/ms/network.git/commitdiff
Move cli_device_status_phy() to functions.phy
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Mar 2019 17:47:47 +0000 (18:47 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Mar 2019 17:47:47 +0000 (18:47 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.phy
src/network

index ee0f2a2eb10d0affb44694941a348014a6cc6906..120117ccf6040cddc2c879ae395000016ff90106 100644 (file)
 
 PHY_DIR="/sys/class/ieee80211"
 
 
 PHY_DIR="/sys/class/ieee80211"
 
+cli_device_status_phy() {
+       local phy="${1}"
+       assert phy_exists "${phy}"
+
+       local address="$(phy_get_address "${phy}")"
+       cli_print_fmt1 1 "Address" "${address}"
+
+       # Show kernel module
+       local driver="$(phy_get_driver "${phy}")"
+       if isset driver; then
+               cli_print_fmt1 1 "Driver" "${driver}"
+       fi
+
+       cli_space
+
+       local devices="$(phy_get_devices "${phy}")"
+       if isset devices; then
+               cli_headline 2 "Soft interfaces"
+
+               local device
+               for device in ${devices}; do
+                       cli_print 2 "* %s" "${device}"
+               done
+               cli_space
+       fi
+
+       cli_headline 2 "Features"
+
+       cli_print_fmt1 2 "Automatic Channel Selection" \
+               "$(phy_supports_acs "${phy}" && print "Supported" || print "Not Supported")"
+       cli_print_fmt1 2 "DFS" \
+               "$(phy_supports_dfs "${phy}" && print "Supported" || print "Not Supported")"
+
+       cli_space
+
+       return ${EXIT_OK}
+}
+
 phy_dir() {
        local phy=${1}
 
 phy_dir() {
        local phy=${1}
 
index 3535133d586434695fcde2689da6bd68734559e7..300ba945b21e035f16ead7910af1a5b6b600b408 100644 (file)
@@ -251,44 +251,6 @@ cli_device_status_serial() {
        fi
 }
 
        fi
 }
 
-cli_device_status_phy() {
-       local phy="${1}"
-       assert phy_exists "${phy}"
-
-       local address="$(phy_get_address "${phy}")"
-       cli_print_fmt1 1 "Address" "${address}"
-
-       # Show kernel module
-       local driver="$(phy_get_driver "${phy}")"
-       if isset driver; then
-               cli_print_fmt1 1 "Driver" "${driver}"
-       fi
-
-       cli_space
-
-       local devices="$(phy_get_devices "${phy}")"
-       if isset devices; then
-               cli_headline 2 "Soft interfaces"
-
-               local device
-               for device in ${devices}; do
-                       cli_print 2 "* %s" "${device}"
-               done
-               cli_space
-       fi
-
-       cli_headline 2 "Features"
-
-       cli_print_fmt1 2 "Automatic Channel Selection" \
-               "$(phy_supports_acs "${phy}" && print "Supported" || print "Not Supported")"
-       cli_print_fmt1 2 "DFS" \
-               "$(phy_supports_dfs "${phy}" && print "Supported" || print "Not Supported")"
-
-       cli_space
-
-       return ${EXIT_OK}
-}
-
 cli_device_discover() {
        local device=${1}
        shift
 cli_device_discover() {
        local device=${1}
        shift