juci-ddns: fix juci.ddns providers call ref #14360
authorReidar Cederqvist <reidar.cederqvist@gmail.com>
Fri, 2 Mar 2018 15:02:15 +0000 (16:02 +0100)
committerReidar Cederqvist <reidar.cederqvist@gmail.com>
Fri, 2 Mar 2018 15:02:24 +0000 (16:02 +0100)
plugins/juci-ddns/ubus/juci.ddns

index 15e49b7..aae83b9 100755 (executable)
@@ -2,6 +2,8 @@
 
 . /usr/share/libubox/jshn.sh
 
+PROVIDERS_FILE="/etc/ddns/services"
+
 case "$1" in
        list)
                echo '{ "providers" : {}, "status": { "service": "Str" } }'
@@ -11,7 +13,7 @@ case "$1" in
                        providers)
                                json_init
                                json_add_array "providers"
-                               for service in $(cat /usr/lib/ddns/services | awk '{print$1}' | tr -d '"'); do
+                               for service in $(cat $PROVIDERS_FILE | awk '{print$1}' | grep -v "#" | tr -d '"'); do
                                        json_add_string "" "$service"
                                done
                                json_dump