]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/functions/functions.dns
bash-completion: Add route and dns-server commands
[people/stevee/network.git] / src / functions / functions.dns
index 5f2e370fd1884c9dae9b1638cd246249ac7037d6..28db4b3900c7a97652c092767713d3a821b5bf4e 100644 (file)
@@ -61,14 +61,10 @@ function dns_server_list() {
 
        local line
        local ${NETWORK_CONFIG_DNS_SERVER_PARAMS}
-
-       local format="%-20s %-8s"
-       print "${format}" "SERVER" "PRIORITY"
-
-       while read -r line; do
+       while read line; do
                dns_server_parse_line ${line} || continue
 
-               print "${format}" "${server}" "${priority}"
+               print "${server}"
        done < ${DNS_SERVER_CONFIG_FILE}
 
        return ${EXIT_OK}
@@ -108,6 +104,24 @@ function dns_server_list_sorted() {
        return ${EXIT_OK}
 }
 
+function dns_server_show() {
+       [ -r "${DNS_SERVER_CONFIG_FILE}" ] || return ${EXIT_OK}
+
+       local line
+       local ${NETWORK_CONFIG_DNS_SERVER_PARAMS}
+
+       local format="%-20s %-8s"
+       print "${format}" "SERVER" "PRIORITY"
+
+       while read -r line; do
+               dns_server_parse_line ${line} || continue
+
+               print "${format}" "${server}" "${priority}"
+       done < ${DNS_SERVER_CONFIG_FILE}
+
+       return ${EXIT_OK}
+}
+
 function dns_server_add() {
        local server=${1}
        assert isset server