diff --git a/luci-app-mihomo/Makefile b/luci-app-mihomo/Makefile index 81cfaed92..7ad2374ac 100644 --- a/luci-app-mihomo/Makefile +++ b/luci-app-mihomo/Makefile @@ -1,6 +1,6 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.13.0 +PKG_VERSION:=1.13.1 LUCI_TITLE:=LuCI Support for mihomo LUCI_DEPENDS:=+luci-base +mihomo diff --git a/mihomo/files/mihomo.init b/mihomo/files/mihomo.init index 2e620fda6..2b641f488 100644 --- a/mihomo/files/mihomo.init +++ b/mihomo/files/mihomo.init @@ -159,8 +159,14 @@ start_service() { cp -f "$profile_file" "$RUN_PROFILE_PATH" elif [[ "$profile" == "subscription:"* ]]; then local subscription_section; subscription_section="${profile/subscription:/}" + local subscription_name subscription_prefer + config_get subscription_name "$subscription_section" "name" + config_get subscription_prefer "$subscription_section" "prefer" "remote" + log "Use Subscription: $subscription_name." local subscription_file; subscription_file="$SUBSCRIPTIONS_DIR/$subscription_section.yaml" - update_subscription "$subscription_section" + if [ "$subscription_prefer" == "remote" ] || [[ "$subscription_prefer" == "local" && ! -f "$subscription_file" ]]; then + update_subscription "$subscription_section" + fi if [ ! -f "$subscription_file" ]; then log "Subscription file not found." log "Exiting..."