@@ -616,6 +616,79 @@ load_second_server()
616
616
[ " $seconddns_tcp_server " = " 1" ] && conf_append_bind " bind-tcp" " $seconddns_port " " $device " " $ipv6_server " " $ARGS "
617
617
}
618
618
619
+ load_second_service ()
620
+ {
621
+ local section=" $1 "
622
+ local server_flags=" "
623
+ local ADDR=" "
624
+ local device=" "
625
+
626
+ config_get_bool enabled " $section " " enabled" " 0"
627
+ [ " $enabled " = " 0" ] && return
628
+
629
+ config_get port " $section " " port" " 6553"
630
+
631
+ config_get_bool no_speed_check " $section " " no_speed_check" " 0"
632
+ [ " $no_speed_check " = " 1" ] && server_flags=" $server_flags -no-speed-check"
633
+
634
+ config_get server_group " $section " " server_group" " "
635
+ [ -z " $server_group " ] || server_flags=" $server_flags -group $server_group "
636
+
637
+ config_get_bool no_rule_addr " $section " " no_rule_addr" " 0"
638
+ [ " $no_rule_addr " = " 1" ] && server_flags=" $server_flags -no-rule-addr"
639
+
640
+ config_get_bool no_rule_nameserver " $section " " no_rule_nameserver" " 0"
641
+ [ " $no_rule_nameserver " = " 1" ] && server_flags=" $server_flags -no-rule-nameserver"
642
+
643
+ config_get_bool no_rule_ipset " $section " " no_rule_ipset" " 0"
644
+ [ " $no_rule_ipset " = " 1" ] && server_flags=" $server_flags -no-rule-ipset"
645
+
646
+ config_get_bool no_rule_soa " $section " " no_rule_soa" " 0"
647
+ [ " $no_rule_soa " = " 1" ] && server_flags=" $server_flags -no-rule-soa"
648
+
649
+ config_get_bool no_dualstack_selection " $section " " no_dualstack_selection" " 0"
650
+ [ " $no_dualstack_selection " = " 1" ] && server_flags=" $server_flags -no-dualstack-selection"
651
+
652
+ config_get_bool no_cache " $section " " no_cache" " 0"
653
+ [ " $no_cache " = " 1" ] && server_flags=" $server_flags -no-cache"
654
+
655
+ config_get_bool force_aaaa_soa " $section " " force_aaaa_soa" " 0"
656
+ [ " $force_aaaa_soa " = " 1" ] && server_flags=" $server_flags -force-aaaa-soa"
657
+
658
+ config_get_bool force_https_soa " $section " " force_https_soa" " 0"
659
+ [ " $force_https_soa " = " 1" ] && server_flags=" $server_flags -force-https-soa"
660
+
661
+ config_get_bool no_ip_alias " $section " " no_ip_alias" " 0"
662
+ [ " $no_ip_alias " = " 1" ] && server_flags=" $server_flags -no-ip-alias"
663
+
664
+ config_get ipset_name " $section " " ipset_name" " "
665
+ [ -z " $ipset_name " ] || server_flags=" $server_flags -ipset $ipset_name "
666
+
667
+ config_get nftset_name " $section " " nftset_name" " "
668
+ [ -z " $nftset_name " ] || server_flags=" $server_flags -nftset $nftset_name "
669
+
670
+ config_get_bool bind_device " $section " " bind_device" " 0"
671
+ config_get bind_device_name " $section " " bind_device_name" " ${lan_device} "
672
+ [ ! -z " $bind_device_name " ] && [ " $bind_device " = " 1" ] && device=" ${bind_device_name} "
673
+ config_get bind_interfaces " $section " " bind_interface" " "
674
+
675
+ config_get_bool " tcp_server" " $section " " tcp_server" " 1"
676
+ config_get ipv6_server " $section " " ipv6_server" " 1"
677
+
678
+ config_get server_flags " $section " " server_flags" " "
679
+ [ -z " $server_flags " ] || server_flags=" $server_flags $server_flags "
680
+ local __conf_bind_func
681
+ if [ ! -z $bind_interfaces ]; then
682
+ __conf_bind_func=" conf_append_bind_interface"
683
+ device=${bind_interfaces}
684
+ else
685
+ __conf_bind_func=" conf_append_bind"
686
+ fi
687
+
688
+ $__conf_bind_func " bind" " $port " " $device " " $ipv6_server " " $server_flags "
689
+ [ " $tcp_server " = " 1" ] && $__conf_bind_func " bind-tcp" " $port " " $device " " $ipv6_server " " $server_flags "
690
+ }
691
+
619
692
conf_append_conf_files ()
620
693
{
621
694
local conf_file=" $1 "
@@ -692,7 +765,7 @@ load_service()
692
765
[ ! -z " $speed_check_mode " ] && conf_append " speed-check-mode" " $speed_check_mode "
693
766
694
767
config_get dualstack_ip_selection " $section " " dualstack_ip_selection" " 0"
695
- [ " $dualstack_ip_selection " = " 0" ] && conf_append " dualstack-ip-selection" " no "
768
+ [ " $dualstack_ip_selection " = " 0" ] && server_flags= " $server_flags -- dualstack-ip-selection"
696
769
697
770
config_get prefetch_domain " $section " " prefetch_domain" " 0"
698
771
[ " $prefetch_domain " = " 1" ] && conf_append " prefetch-domain" " yes"
@@ -707,10 +780,10 @@ load_service()
707
780
[ " $resolve_local_hostnames " = " 1" ] && conf_append " dnsmasq-lease-file" " $dnsmasq_lease_file "
708
781
709
782
config_get force_aaaa_soa " $section " " force_aaaa_soa" " 0"
710
- [ " $force_aaaa_soa " = " 1" ] && qtype_soa_list =" $qtype_soa_list 28 "
783
+ [ " $force_aaaa_soa " = " 1" ] && server_flags =" $server_flags -force-aaaa-soa "
711
784
712
- config_get force_https_soa " $section " " force_https_soa" " 1 "
713
- [ " $force_https_soa " = " 1" ] && qtype_soa_list =" $qtype_soa_list 65 "
785
+ config_get force_https_soa " $section " " force_https_soa" " 0 "
786
+ [ " $force_https_soa " = " 1" ] && server_flags =" $server_flags -force-https-soa "
714
787
715
788
config_get auto_set_dnsmasq " $section " " auto_set_dnsmasq" " 1"
716
789
@@ -885,6 +958,7 @@ load_service()
885
958
[ ! -z " $bind_cert_key_pass " ] && conf_append " bind-cert-key-pass" " $bind_cert_key_pass "
886
959
887
960
load_second_server " $section "
961
+ config_foreach load_second_service " service"
888
962
889
963
config_foreach load_server " server"
890
964
0 commit comments