]> git.ipfire.org Git - people/stevee/network.git/blobdiff - functions.ports
6rd: Change cmdline option to public-ipv4-address.
[people/stevee/network.git] / functions.ports
index 52b44e84acccd41f5fe598bf39ff96c7008dfb7d..198a08ba3694576e1102c41087c8b04971907958 100644 (file)
 ###############################################################################
 
 function port_dir() {
-       echo "${CONFIG_DIR}/ports"
+       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() {
@@ -35,7 +69,6 @@ function ports_get_all() {
 
 function port_file() {
        local port=${1}
-
        assert isset port
 
        echo "$(port_dir)/${port}"
@@ -44,7 +77,7 @@ function port_file() {
 function port_exists() {
        local port=${1}
 
-       [ -f "${CONFIG_DIR}/ports/${port}" ]
+       [ -f "${NETWORK_CONFIG_DIR}/ports/${port}" ]
 }
 
 function port_get_hook() {