luci-app-openclash: bump to v0.39.8-beta

This commit is contained in:
CN_SZTL 2020-08-22 20:31:44 +08:00
parent 16d3cdedc0
commit 4bf63f0a4d
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
11 changed files with 53 additions and 40 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.39.7
PKG_VERSION:=0.39.8
PKG_RELEASE:=beta
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

File diff suppressed because one or more lines are too long

View File

@ -192,35 +192,29 @@
function core_update(btn)
{
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "coreupdate")%>', null, function(x, status) {
btn.value = '<%:检查并更新%>';
btn.disabled = false;
return false;
return false;
});
}
function core_tun_update(btn)
{
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "coretunupdate")%>', null, function(x, status) {
btn.value = '<%:检查并更新%>';
btn.disabled = false;
return false;
return false;
});
}
function core_game_update(btn)
{
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "coregameupdate")%>', null, function(x, status) {
btn.value = '<%:检查并更新%>';
btn.disabled = false;
return false;
return false;
});
}
function op_update(btn)

View File

@ -1 +1 @@
<!doctype html><html lang="en" dir="ltr"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/Dreamacro/clash/docs/logo.png"/><title>Clash</title><link href="main.658aa6a6e3feec8f168b.css" rel="stylesheet"></head><body><div id="root"></div><script src="js/1.bundle.658aa6a6e3feec8f168b.min.js"></script><script src="js/bundle.658aa6a6e3feec8f168b.min.js"></script></body></html>
<!doctype html><html lang="en" dir="ltr"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/Dreamacro/clash/docs/logo.png"/><title>Clash</title><link href="main.01d1a3c82895ade21dbf.css" rel="stylesheet"></head><body><div id="root"></div><script src="js/1.bundle.01d1a3c82895ade21dbf.min.js"></script><script src="js/bundle.01d1a3c82895ade21dbf.min.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,6 @@
#!/bin/bash
#!/bin/sh
. /lib/functions.sh
#禁止多个实例
status=$(ps|grep -c /usr/share/openclash/openclash_core.sh)
[ "$status" -gt "3" ] && exit 0
START_LOG="/tmp/openclash_start.log"
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
LOG_FILE="/tmp/openclash.log"
@ -50,11 +46,11 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
case $CORE_TYPE in
"Tun")
echo "正在下载【Tun】版本内核如下载失败请尝试手动下载并上传..." >$START_LOG
curl -sL -m 30 --retry 2 -x http://$PROXY_ADDR:$HTTP_PORT -U "$PROXY_AUTH" https://github.com/vernesong/OpenClash/releases/download/TUN-Premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash.gz >/dev/null 2>&1
curl -sL -m 30 --retry 2 -x http://$PROXY_ADDR:$HTTP_PORT -U "$PROXY_AUTH" https://github.com/vernesong/OpenClash/releases/download/TUN-Premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz >/dev/null 2>&1
;;
"Game")
echo "正在下载【Game】版本内核如下载失败请尝试手动下载并上传..." >$START_LOG
curl -sL -m 30 --retry 2 -x http://$PROXY_ADDR:$HTTP_PORT -U "$PROXY_AUTH" https://github.com/vernesong/OpenClash/releases/download/TUN/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz >/dev/null 2>&1
curl -sL -m 30 --retry 2 -x http://$PROXY_ADDR:$HTTP_PORT -U "$PROXY_AUTH" https://github.com/vernesong/OpenClash/releases/download/TUN/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_game.tar.gz >/dev/null 2>&1
;;
*)
echo "正在下载【Dev】版本内核如下载失败请尝试手动下载并上传..." >$START_LOG
@ -64,11 +60,11 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
case $CORE_TYPE in
"Tun")
echo "正在下载【Tun】版本内核如下载失败请尝试手动下载并上传..." >$START_LOG
curl -sL -m 30 --retry 2 https://github.com/vernesong/OpenClash/releases/download/TUN-Premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash.gz >/dev/null 2>&1
curl -sL -m 30 --retry 2 https://github.com/vernesong/OpenClash/releases/download/TUN-Premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz >/dev/null 2>&1
;;
"Game")
echo "正在下载【Game】版本内核如下载失败请尝试手动下载并上传..." >$START_LOG
curl -sL -m 30 --retry 2 https://github.com/vernesong/OpenClash/releases/download/TUN/clash-"$CPU_MODEL".tar.gz -o /tmp/clash.tar.gz >/dev/null 2>&1
curl -sL -m 30 --retry 2 https://github.com/vernesong/OpenClash/releases/download/TUN/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_game.tar.gz >/dev/null 2>&1
;;
*)
echo "正在下载【Dev】版本内核如下载失败请尝试手动下载并上传..." >$START_LOG
@ -78,27 +74,32 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
if [ "$?" -eq "0" ]; then
case $CORE_TYPE in
"Tun")
[ -s "/tmp/clash.gz" ] && {
gzip -d /tmp/clash.gz >/dev/null 2>&1
[ -s "/tmp/clash_tun.gz" ] && {
gzip -d /tmp/clash_tun.gz >/dev/null 2>&1 && mv /tmp/clash /tmp/clash_tun >/dev/null 2>&1
rm -rf /tmp/clash_tun.gz >/dev/null 2>&1
rm -rf /etc/openclash/core/clash_tun >/dev/null 2>&1
chmod 4755 /tmp/clash_tun >/dev/null 2>&1
chown root:root /tmp/clash_tun >/dev/null 2>&1
}
;;
"Game")
[ -s "/tmp/clash.tar.gz" ] && {
tar zxvf /tmp/clash.tar.gz -C /tmp >/dev/null 2>&1
[ -s "/tmp/clash_game.tar.gz" ] && {
tar zxvf /tmp/clash_game.tar.gz -C /tmp >/dev/null 2>&1 && mv /tmp/clash /tmp/clash_game >/dev/null 2>&1
rm -rf /tmp/clash_game.tar.gz >/dev/null 2>&1
rm -rf /etc/openclash/core/clash_game >/dev/null 2>&1
chmod 4755 /tmp/clash_game >/dev/null 2>&1
chown root:root /tmp/clash_game >/dev/null 2>&1
}
;;
*)
[ -s "/tmp/clash.tar.gz" ] && {
tar zxvf /tmp/clash.tar.gz -C /tmp >/dev/null 2>&1
tar zxvf /tmp/clash.tar.gz -C /tmp
rm -rf /tmp/clash.tar.gz >/dev/null 2>&1
rm -rf /etc/openclash/core/clash >/dev/null 2>&1
chmod 4755 /tmp/clash >/dev/null 2>&1
chown root:root /tmp/clash >/dev/null 2>&1
}
esac
chmod 4755 /tmp/clash >/dev/null 2>&1
chown root:root /tmp/clash >/dev/null 2>&1
rm -rf /tmp/clash.tar.gz >/dev/null 2>&1
rm -rf /tmp/clash.gz >/dev/null 2>&1
mkdir -p /etc/openclash/core
if [ "$if_restart" -eq 1 ]; then
kill -9 "$(pidof clash|sed 's/$//g')" 2>/dev/null
@ -107,31 +108,49 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
echo "【"$CORE_TYPE"】版本内核下载成功,开始更新..." >$START_LOG
case $CORE_TYPE in
"Tun")
mv /tmp/clash /etc/openclash/core/clash_tun >/dev/null 2>&1
mv /tmp/clash_tun /etc/openclash/core/clash_tun >/dev/null 2>&1
;;
"Game")
mv /tmp/clash /etc/openclash/core/clash_game >/dev/null 2>&1
mv /tmp/clash_game /etc/openclash/core/clash_game >/dev/null 2>&1
;;
*)
mv /tmp/clash /etc/openclash/core/clash >/dev/null 2>&1
esac
if [ "$?" -eq "0" ]; then
[ "$if_restart" -eq 1 ] && /etc/init.d/openclash start
echo "【"$CORE_TYPE"】版本内核更新成功!" >$START_LOG
echo "${LOGTIME} OpenClash 【"$CORE_TYPE"】 Core Update Successful" >>$LOG_FILE
sleep 5
sleep 3
[ "$if_restart" -eq 1 ] && /etc/init.d/openclash start
echo "" >$START_LOG
else
echo "【"$CORE_TYPE"】版本内核更新失败,请确认设备闪存空间足够后再试!" >$START_LOG
echo "${LOGTIME} OpenClash 【"$CORE_TYPE"】 Core Update Error" >>$LOG_FILE
rm -rf /tmp/clash >/dev/null 2>&1
case $CORE_TYPE in
"Tun")
rm -rf /tmp/clash_tun >/dev/null 2>&1
;;
"Game")
rm -rf /tmp/clash_game >/dev/null 2>&1
;;
*)
rm -rf /tmp/clash >/dev/null 2>&1
esac
sleep 5
echo "" >$START_LOG
fi
else
echo "【"$CORE_TYPE"】版本内核下载失败,请检查网络或稍后再试!" >$START_LOG
echo "${LOGTIME} OpenClash 【"$CORE_TYPE"】 Core Update Error" >>$LOG_FILE
rm -rf /tmp/clash >/dev/null 2>&1
case $CORE_TYPE in
"Tun")
rm -rf /tmp/clash_tun >/dev/null 2>&1
;;
"Game")
rm -rf /tmp/clash_game >/dev/null 2>&1
;;
*)
rm -rf /tmp/clash >/dev/null 2>&1
esac
sleep 10
echo "" >$START_LOG
fi