]> git.ipfire.org Git - people/stevee/network.git/blobdiff - functions.ports
wireless: Add function to find DFS channels.
[people/stevee/network.git] / functions.ports
index 89ab98f63b3608226209b719d644a1b66b458b83..198a08ba3694576e1102c41087c8b04971907958 100644 (file)
@@ -23,6 +23,40 @@ function port_dir() {
        echo "${NETWORK_CONFIG_DIR}/ports"
 }
 
+function port_get_hook() {
+       local port=${1}
+       assert isset port
+
+       config_get_hook $(port_file ${port})
+}
+
+function port_config_dir() {
+       local port=${1}
+
+       print "${RUN_DIR}/ports/${port}"
+       return ${EXIT_OK}
+}
+
+function port_config_read() {
+       local port=${1}
+       assert isset port
+
+       # Save the HOOK variable.
+       local hook="${HOOK}"
+
+       config_read $(port_file ${port})
+
+       # Restore hook.
+       HOOK="${hook}"
+}
+
+function port_config_write() {
+       local port=${1}
+       assert isset port
+
+       config_write $(port_file ${port})
+}
+
 function ports_get_all() {
        local port
 
@@ -35,7 +69,6 @@ function ports_get_all() {
 
 function port_file() {
        local port=${1}
-
        assert isset port
 
        echo "$(port_dir)/${port}"