]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/functions/functions.ports
Introduce list_directory
[people/stevee/network.git] / src / functions / functions.ports
index 5defe0165c1382d38aea3959c23f0bb815f349b0..2537f815a143327a833ebc0e0150d2a9ce041603 100644 (file)
@@ -25,13 +25,7 @@ port_dir() {
 }
 
 port_list() {
-       local port
-       for port in $(port_dir)/*; do
-               port="$(basename "${port}")"
-               if port_exists "${port}"; then
-                       print "${port}"
-               fi
-       done
+       list_directory "$(port_dir)"
 }
 
 port_list_in_use() {
@@ -280,8 +274,7 @@ port_cmd() {
 
 ports_get() {
        local port
-       for port in $(port_dir)/*; do
-               port=$(basename ${port})
+       for port in $(list_directory "$(port_dir)"); do
                if port_exists ${port}; then
                        echo "${port}"
                fi