xfrpc: allow server_addr ip and domain
authorDengfeng Liu <[email protected]>
Fri, 14 Oct 2022 08:36:16 +0000 (08:36 +0000)
committerTianling Shen <[email protected]>
Mon, 27 Feb 2023 02:47:11 +0000 (10:47 +0800)
Signed-off-by: Dengfeng Liu <[email protected]>
(cherry picked from commit a7e3f28c3761de6e7eed5423fbd116eeeec38491)

net/xfrpc/files/xfrpc.init

index aa999bc68a253c26e83091aa780b92653e079d46..3b0ddedafca7d8d6d40365eb85736715ae1cb2ad 100755 (executable)
@@ -34,14 +34,16 @@ handle_xfrpc() {
                        ;;
                http|https)
                        config_get custom_domains "$name" custom_domains
-                       echo "custom_domains = $custom_domains" >> "$config"
+                       [ -z "$custom_domains" ] || echo "custom_domains = $custom_domains" >> "$config"
+                       config_get subdomain "$name" subdomain
+                       [ -z "$subdomain" ] || echo "subdomain = $subdomain" >> "$config"
                        ;;
                esac
        }
 
        if [ "$name" = "common" ]; then
                uci_validate_section xfrpc xfrp "$name" \
-                               'server_addr:ipaddr' \
+                               'server_addr:host' \
                                'server_port:uinteger' \
                                'token:string:'