]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/functions/functions.dhcpd
bash-completion: Add some basic completion for DHCP servers
[people/stevee/network.git] / src / functions / functions.dhcpd
index 75153eaf1e7066b05fc59e9ce8217f686cfb2ad7..f6732db33f5e0539323ede03b6d18005509b2be8 100644 (file)
@@ -332,6 +332,13 @@ function dhcpd_options() {
        return ${EXIT_OK}
 }
 
+function dhcpd_global_settings_list() {
+       local proto="${1}"
+       assert isset proto
+
+       dhcpd_settings "${proto}"
+}
+
 function dhcpd_global_settings_defaults() {
        local proto=${1}
        assert isset proto
@@ -359,7 +366,7 @@ function dhcpd_global_settings_read() {
        assert isset settings
 
        dhcpd_global_settings_defaults ${proto}
-       config_read ${file} ${settings}
+       settings_read ${file} ${settings}
 }
 
 function dhcpd_global_settings_write() {
@@ -372,7 +379,7 @@ function dhcpd_global_settings_write() {
        local settings=$(dhcpd_settings ${proto})
        assert isset settings
 
-       config_write ${file} ${settings}
+       settings_write ${file} ${settings}
 }
 
 function dhcpd_global_options_read() {
@@ -382,7 +389,7 @@ function dhcpd_global_options_read() {
        local options_file=$(dhcpd_options_file ${proto})
        local options_list=$(dhcpd_options_list ${proto})
 
-       config_read_array ${options_file} options ${!options_list}
+       settings_read_array ${options_file} options ${!options_list}
 
        # Check if domain-name is set.
        if [ -z "${options["domain-name"]}" ]; then
@@ -566,7 +573,7 @@ function dhcpd_subnet_edit() {
        # XXX Check for subnet collisions!
 
        local file="$(dhcpd_subnet_path ${proto} ${id})/settings"
-       config_write ${file} ${settings}
+       settings_write ${file} ${settings}
 }
 
 function dhcpd_subnet_remove() {
@@ -610,7 +617,7 @@ function dhcpd_subnet_read() {
        assert isset id
 
        local file="$(dhcpd_subnet_path ${proto} ${id})/settings"
-       config_read ${file}
+       settings_read ${file}
 }
 
 function dhcpd_subnet_range_path() {
@@ -773,7 +780,7 @@ function dhcpd_subnet_range_edit() {
        local file=$(dhcpd_subnet_range_path ${proto} ${subnet_id} ${range_id})
        assert isset file
 
-       config_write ${file} ${settings}
+       settings_write ${file} ${settings}
 }
 
 function dhcpd_subnet_range_remove() {
@@ -815,7 +822,7 @@ function dhcpd_subnet_range_read() {
        assert isset range_id
 
        local file=$(dhcpd_subnet_range_path ${proto} ${subnet_id} ${range_id})
-       config_read ${file}
+       settings_read ${file}
 }
 
 function dhcpd_subnet_settings() {
@@ -842,21 +849,7 @@ function dhcpd_subnet_options_file() {
 
 function dhcpd_subnet_options_list() {
        local proto=${1}
-
-       case "${proto}" in
-               ipv6)
-                       print "DHCPV6D_SUBNET_OPTIONS"
-                       ;;
-               ipv4)
-                       print "DHCPV4D_SUBNET_OPTIONS"
-                       ;;
-       esac
-
-       return ${EXIT_OK}
-}
-
-function dhcpd_subnet_options() {
-       local proto=${1}
+       assert isset proto
 
        case "${proto}" in
                ipv6)
@@ -931,7 +924,7 @@ function _dhcpd_read_options() {
        local options_list=${2}
        assert isset options_list
 
-       config_read_array ${file} options ${!options_list}
+       settings_read_array ${file} options ${!options_list}
 }
 
 function _dhcpd_write_subnet() {