Skip to content

Commit

Permalink
chore: refine
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Sep 9, 2024
1 parent 78e4dec commit 6a6c3b5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 40 deletions.
11 changes: 10 additions & 1 deletion luci-app-openclash/po/zh-cn/openclash.zh-cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -3370,4 +3370,13 @@ msgid "Blacklist Mode"
msgstr "黑名单模式"

msgid "Whitelist Mode"
msgstr "白名单模式"
msgstr "白名单模式"

msgid "Group Cached Compliant Nodes Number: "
msgstr "策略组已缓存的符合设置要求的节点数量: "

msgid ", Cached Non-compliant Nodes Number: "
msgstr ",不符合设置要求的节点数量: "

msgid ", Prioritize Testing With Cached Compliant Nodes ..."
msgstr ",程序将优先使用符合要求的节点进行测试 ..."
13 changes: 0 additions & 13 deletions luci-app-openclash/root/usr/share/openclash/openclash_geoip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
GEOIP_CUSTOM_URL=$(uci get openclash.config.geoip_custom_url 2>/dev/null)
github_address_mod=$(uci -q get openclash.config.github_address_mod || echo 0)
LOG_FILE="/tmp/openclash.log"
restart=0
set_lock

if [ "$small_flash_memory" != "1" ]; then
Expand Down Expand Up @@ -50,25 +49,13 @@
rm -rf "/etc/openclash/geoip.dat"
mv /tmp/GeoIP.dat "$geoip_path" >/dev/null 2>&1
LOG_OUT "GeoIP Dat Update Successful!"
restart=1
else
LOG_OUT "Updated GeoIP Dat No Change, Do Nothing..."
fi
else
LOG_OUT "GeoIP Dat Update Error, Please Try Again Later..."
fi

if [ "$restart" -eq 1 ] && [ "$(unify_ps_prevent)" -eq 0 ] && [ "$(find /tmp/lock/ |grep -v "openclash.lock" |grep -c "openclash")" -le 1 ]; then
/etc/init.d/openclash restart >/dev/null 2>&1 &
elif [ "$restart" -eq 0 ] && [ "$(unify_ps_prevent)" -eq 0 ] && [ "$(find /tmp/lock/ |grep -v "openclash.lock" |grep -c "openclash")" -le 1 ] && [ "$(uci -q get openclash.config.restart)" -eq 1 ]; then
/etc/init.d/openclash restart >/dev/null 2>&1 &
uci -q set openclash.config.restart=0
uci -q commit openclash
elif [ "$restart" -eq 1 ] && [ "$(unify_ps_prevent)" -eq 0 ]; then
uci -q set openclash.config.restart=1
uci -q commit openclash
fi

rm -rf /tmp/GeoIP.dat >/dev/null 2>&1
SLOG_CLEAN
del_lock
13 changes: 0 additions & 13 deletions luci-app-openclash/root/usr/share/openclash/openclash_geosite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
GEOSITE_CUSTOM_URL=$(uci get openclash.config.geosite_custom_url 2>/dev/null)
github_address_mod=$(uci -q get openclash.config.github_address_mod || echo 0)
LOG_FILE="/tmp/openclash.log"
restart=0
set_lock

if [ "$small_flash_memory" != "1" ]; then
Expand Down Expand Up @@ -50,25 +49,13 @@
rm -rf "/etc/openclash/geosite.dat"
mv /tmp/GeoSite.dat "$geosite_path" >/dev/null 2>&1
LOG_OUT "GeoSite Database Update Successful!"
restart=1
else
LOG_OUT "Updated GeoSite Database No Change, Do Nothing..."
fi
else
LOG_OUT "GeoSite Database Update Error, Please Try Again Later..."
fi

if [ "$restart" -eq 1 ] && [ "$(unify_ps_prevent)" -eq 0 ] && [ "$(find /tmp/lock/ |grep -v "openclash.lock" |grep -c "openclash")" -le 1 ]; then
/etc/init.d/openclash restart >/dev/null 2>&1 &
elif [ "$restart" -eq 0 ] && [ "$(unify_ps_prevent)" -eq 0 ] && [ "$(find /tmp/lock/ |grep -v "openclash.lock" |grep -c "openclash")" -le 1 ] && [ "$(uci -q get openclash.config.restart)" -eq 1 ]; then
/etc/init.d/openclash restart >/dev/null 2>&1 &
uci -q set openclash.config.restart=0
uci -q commit openclash
elif [ "$restart" -eq 1 ] && [ "$(unify_ps_prevent)" -eq 0 ]; then
uci -q set openclash.config.restart=1
uci -q commit openclash
fi

rm -rf /tmp/GeoSite.dat >/dev/null 2>&1
SLOG_CLEAN
del_lock
13 changes: 0 additions & 13 deletions luci-app-openclash/root/usr/share/openclash/openclash_ipdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
GEOIP_CUSTOM_URL=$(uci get openclash.config.geo_custom_url 2>/dev/null)
github_address_mod=$(uci -q get openclash.config.github_address_mod || echo 0)
LOG_FILE="/tmp/openclash.log"
restart=0
set_lock

if [ "$small_flash_memory" != "1" ]; then
Expand Down Expand Up @@ -49,25 +48,13 @@
LOG_OUT "Geoip Database Has Been Updated, Starting To Replace The Old Version..."
mv /tmp/Country.mmdb "$geoip_path" >/dev/null 2>&1
LOG_OUT "Geoip Database Update Successful!"
restart=1
else
LOG_OUT "Updated Geoip Database No Change, Do Nothing..."
fi
else
LOG_OUT "Geoip Database Update Error, Please Try Again Later..."
fi

if [ "$restart" -eq 1 ] && [ "$(unify_ps_prevent)" -eq 0 ] && [ "$(find /tmp/lock/ |grep -v "openclash.lock" |grep -c "openclash")" -le 1 ]; then
/etc/init.d/openclash restart >/dev/null 2>&1 &
elif [ "$restart" -eq 0 ] && [ "$(unify_ps_prevent)" -eq 0 ] && [ "$(find /tmp/lock/ |grep -v "openclash.lock" |grep -c "openclash")" -le 1 ] && [ "$(uci -q get openclash.config.restart)" -eq 1 ]; then
/etc/init.d/openclash restart >/dev/null 2>&1 &
uci -q set openclash.config.restart=0
uci -q commit openclash
elif [ "$restart" -eq 1 ] && [ "$(unify_ps_prevent)" -eq 0 ]; then
uci -q set openclash.config.restart=1
uci -q commit openclash
fi

rm -rf /tmp/Country.mmdb >/dev/null 2>&1
SLOG_CLEAN
del_lock
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,9 @@ function table_sort_by_cache(t)
table.insert(tab_b, t[n])
end
end
if #tab > 0 then
print(os.date("%Y-%m-%d %H:%M:%S").." "..type.." ".."Group Cached Compliant Nodes Number: "..""..#(tab)..""..", Cached Non-compliant Nodes Number: "..""..#(tab_b)..""..", Prioritize Testing With Cached Compliant Nodes ...")
end
for k,v in pairs(tab_b) do table.insert(tab, v) end
return tab
end
Expand Down

0 comments on commit 6a6c3b5

Please sign in to comment.