chore: shfmt formatting

This commit is contained in:
Andrey Petelin
2025-09-11 16:40:06 +05:00
parent 074c1a9349
commit a7f6a993ac

View File

@@ -468,8 +468,8 @@ add_cron_job() {
;; ;;
esac esac
if [ "$community_lists_enabled" -eq 1 ] || \ if [ "$community_lists_enabled" -eq 1 ] ||
[ "$remote_domain_lists_enabled" -eq 1 ] || \ [ "$remote_domain_lists_enabled" -eq 1 ] ||
[ "$remote_subnet_lists_enabled" -eq 1 ]; then [ "$remote_subnet_lists_enabled" -eq 1 ]; then
remove_cron_job remove_cron_job
crontab -l | { crontab -l | {
@@ -1004,10 +1004,12 @@ configure_local_domain_or_subnet_lists() {
domains) domains)
config_list_foreach "$section" "local_domain_lists" import_local_domain_or_subnet_list "$type" \ config_list_foreach "$section" "local_domain_lists" import_local_domain_or_subnet_list "$type" \
"$section" "$ruleset_filepath" "$section" "$ruleset_filepath"
_add_ruleset_to_dns_rules "$ruleset_tag" "$route_rule_tag" ;; _add_ruleset_to_dns_rules "$ruleset_tag" "$route_rule_tag"
;;
subnets) subnets)
config_list_foreach "$section" "local_subnet_lists" import_local_domain_or_subnet_list "$type" \ config_list_foreach "$section" "local_subnet_lists" import_local_domain_or_subnet_list "$type" \
"$section" "$ruleset_filepath";; "$section" "$ruleset_filepath"
;;
*) log "Unsupported local rule set type: $type" "warn" ;; *) log "Unsupported local rule set type: $type" "warn" ;;
esac esac
} }
@@ -1418,12 +1420,12 @@ section_has_enabled_lists() {
config_get_bool local_subnet_lists_enabled "$section" "local_subnet_lists_enabled" 0 config_get_bool local_subnet_lists_enabled "$section" "local_subnet_lists_enabled" 0
config_get_bool remote_subnet_lists_enabled "$section" "remote_subnet_lists_enabled" 0 config_get_bool remote_subnet_lists_enabled "$section" "remote_subnet_lists_enabled" 0
if [ "$community_lists_enabled" -ne 0 ] || \ if [ "$community_lists_enabled" -ne 0 ] ||
[ "$user_domain_list_type" != "disabled" ] || \ [ "$user_domain_list_type" != "disabled" ] ||
[ "$local_domain_lists_enabled" -ne 0 ] || \ [ "$local_domain_lists_enabled" -ne 0 ] ||
[ "$remote_domain_lists_enabled" -ne 0 ] || \ [ "$remote_domain_lists_enabled" -ne 0 ] ||
[ "$user_subnet_list_type" != "disabled" ] || \ [ "$user_subnet_list_type" != "disabled" ] ||
[ "$local_subnet_lists_enabled" -ne 0 ] || \ [ "$local_subnet_lists_enabled" -ne 0 ] ||
[ "$remote_subnet_lists_enabled" -ne 0 ]; then [ "$remote_subnet_lists_enabled" -ne 0 ]; then
return 0 return 0
else else
@@ -1490,8 +1492,7 @@ check_proxy() {
nolog "Checking proxy connection..." nolog "Checking proxy connection..."
for attempt in $(seq 1 5); do
for attempt in `seq 1 5`; do
response=$(sing-box tools fetch ifconfig.me -D /etc/sing-box 2> /dev/null) response=$(sing-box tools fetch ifconfig.me -D /etc/sing-box 2> /dev/null)
if echo "$response" | grep -q "^<html\|403 Forbidden"; then if echo "$response" | grep -q "^<html\|403 Forbidden"; then
continue continue
@@ -1889,7 +1890,8 @@ check_dns_available() {
fi fi
fi fi
elif [ "$dns_type" = "dot" ]; then elif [ "$dns_type" = "dot" ]; then
(nc "$dns_server" 853 </dev/null >/dev/null 2>&1) & pid=$! (nc "$dns_server" 853 < /dev/null > /dev/null 2>&1) &
pid=$!
sleep 2 sleep 2
if kill -0 $pid 2> /dev/null; then if kill -0 $pid 2> /dev/null; then
kill $pid 2> /dev/null kill $pid 2> /dev/null