Skip to content

Commit

Permalink
chore: refine
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Nov 20, 2024
1 parent 74079f6 commit ce0ef71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions luci-app-openclash/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ define Package/$(PKG_NAME)/prerm
#!/bin/sh
uci -q set openclash.config.enable=0
uci -q commit openclash
[ -n "$(pidof clash)" ] && /etc/init.d/openclash stop 2>/dev/null
cp -f "/etc/config/openclash" "/tmp/openclash.bak" >/dev/null 2>&1
cp -rf "/etc/openclash" "/tmp/openclash" >/dev/null 2>&1
cp -rf "/usr/share/openclash/ui/yacd" "/tmp/openclash_yacd" >/dev/null 2>&1
Expand Down
2 changes: 2 additions & 0 deletions luci-app-openclash/root/usr/share/openclash/openclash_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
uci -q set openclash.config.config_reload=1
uci -q commit openclash
if ([ -z "$2" ] || ([ -n "$2" ] && [ "$2" != "one_key_update" ])) && [ "$(find /tmp/lock/ |grep -v "openclash.lock" |grep -c "openclash")" -le 1 ] && [ "$(unify_ps_prevent)" -eq 0 ]; then
uci -q set openclash.config.config_reload=0
uci -q commit openclash
/etc/init.d/openclash restart >/dev/null 2>&1 &
fi
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ if [ -n "$OP_CV" ] && [ -n "$OP_LV" ] && [ "$(expr "$OP_LV" \> "$OP_CV")" -eq 1
if [ -z "$(opkg install /tmp/openclash.ipk --noaction 2>/dev/null |grep 'Upgrading luci-app-openclash on root' 2>/dev/null)" ]; then
LOG_OUT "【OpenClash - v$LAST_VER】Pre Update Test Failed, The File is Saved in /tmp/openclash.ipk, Please Try to Update Manually!"
if [ "$(uci -q get openclash.config.config_reload)" -eq 1 ]; then
uci -q set openclash.config.config_reload=0
uci -q commit openclash
/etc/init.d/openclash restart >/dev/null 2>&1 &
else
SLOG_CLEAN
Expand Down Expand Up @@ -178,6 +180,8 @@ EOF
rm -rf /tmp/openclash.ipk >/dev/null 2>&1
rm -rf /tmp/openclash.apk >/dev/null 2>&1
if [ "$(uci -q get openclash.config.config_reload)" -eq 1 ]; then
uci -q set openclash.config.config_reload=0
uci -q commit openclash
/etc/init.d/openclash restart >/dev/null 2>&1 &
else
SLOG_CLEAN
Expand All @@ -190,6 +194,8 @@ else
LOG_OUT "OpenClash Has not Been Updated, Stop Continuing!"
fi
if [ "$(uci -q get openclash.config.config_reload)" -eq 1 ]; then
uci -q set openclash.config.config_reload=0
uci -q commit openclash
/etc/init.d/openclash restart >/dev/null 2>&1 &
else
SLOG_CLEAN
Expand Down

0 comments on commit ce0ef71

Please sign in to comment.