luci-app-ddns: fix creation of custom service (fix #4926) 5999/head
authorJulien Cassette <julien.cassette@gmail.com>
Sun, 2 Oct 2022 18:14:19 +0000 (20:14 +0200)
committerJulien Cassette <julien.cassette@gmail.com>
Sun, 2 Oct 2022 18:25:20 +0000 (20:25 +0200)
The `service_name` option must be empty for custom services,
otherwise an error is raised in `dynamic_dns_updater.sh`.

Signed-off-by: Julien Cassette <julien.cassette@gmail.com>
applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js

index 8a8c27c71873e088440c5625957152ebda5e8e6e..d395f411a3c345e52ac85e4e71db6e6283692515 100644 (file)
@@ -477,7 +477,9 @@ return view.extend({
 
                        return m.save(function() {
                                uci.add('ddns', 'service', section_id);
-                               uci.set('ddns', section_id, 'service_name', service_value);
+                               if (service_value != '-') {
+                                       uci.set('ddns', section_id, 'service_name', service_value);
+                               }
                                uci.set('ddns', section_id, 'use_ipv6', ipv6_value);
                        }).then(L.bind(m.children[1].renderMoreOptionsModal, m.children[1], section_id));
                };