From df1873b00e63a22da9a97a1f583c35536a49f66f Mon Sep 17 00:00:00 2001 From: vernesong <42875168+vernesong@users.noreply.github.com> Date: Thu, 8 Dec 2022 20:44:18 +0800 Subject: [PATCH] chore: core restart when firewall reload --- luci-app-openclash/root/etc/init.d/openclash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/luci-app-openclash/root/etc/init.d/openclash b/luci-app-openclash/root/etc/init.d/openclash index ee865a0de6..c0e7322cb9 100644 --- a/luci-app-openclash/root/etc/init.d/openclash +++ b/luci-app-openclash/root/etc/init.d/openclash @@ -734,7 +734,7 @@ start_run_core() fi config_reload=$(uci -q get openclash.config.config_reload) if [ -n "$(pidof clash)" ] && [ "$core_type" != "TUN" ] && [ "$core_type" != "Meta" ] && [ "$config_reload" != "0" ]; then - curl -s --connect-timeout 5 -m 5 -H 'Content-Type: application/json' -H "Authorization: Bearer ${da_password}" -XPUT http://"$lan_ip":"$cn_port"/configs -d "{\"path\": \"$CONFIG_FILE\"}" 2>/dev/null + curl -s --connect-timeout 5 -m 5 -H 'Content-Type: application/json' -H "Authorization: Bearer ${da_password}" -XPUT http://"$lan_ip":"$cn_port"/configs?force=true -d "{\"path\": \"$CONFIG_FILE\"}" 2>/dev/null else kill_clash if [ -z "$_koolshare" ]; then @@ -2653,6 +2653,8 @@ reload() revert_firewall 2>/dev/null do_run_mode 2>/dev/null get_config 2>/dev/null + start_run_core + check_core_status set_firewall 2>/dev/null /etc/init.d/dnsmasq restart >/dev/null 2>&1 SLOG_CLEAN