luci-app-clash: bump to 1.6.0b
This commit is contained in:
parent
7c269d5839
commit
cbb780da47
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-clash
|
||||
PKG_VERSION:=1.5.9
|
||||
PKG_VERSION:=1.6.0
|
||||
PKG_MAINTAINER:=frainzy1477
|
||||
|
||||
|
||||
|
||||
@ -33,10 +33,8 @@ revert_dns() {
|
||||
add_cron(){
|
||||
config_type=$(uci get clash.config.config_type 2>/dev/null)
|
||||
#===========================================================================================================================
|
||||
sed -i '/clash.txt/d' $CRON_FILE
|
||||
|
||||
[ -z "$(grep -w "/usr/share/clash/clash-watchdog.sh" $CRON_FILE)" ] && echo "*/1 * * * * /usr/share/clash/clash-watchdog.sh" >> $CRON_FILE
|
||||
|
||||
[ -z "$(grep -w "/usr/share/clash/kill_watchdog.sh" $CRON_FILE)" ] && echo "*/1 * * * * /usr/share/clash/kill_watchdog.sh" >> $CRON_FILE
|
||||
clear=$(uci get clash.config.auto_clear_log 2>/dev/null)
|
||||
if [ "${clear}" -eq 1 ]; then
|
||||
[ -z "$(grep -w "/usr/share/clash/clash.txt" $CRON_FILE)" ] && echo "0 */$(uci get clash.config.clear_time 2>/dev/null) * * * echo '' >/usr/share/clash/clash.txt" >> $CRON_FILE
|
||||
@ -70,6 +68,7 @@ config_type=$(uci get clash.config.config_type 2>/dev/null)
|
||||
|
||||
del_cron(){
|
||||
#===========================================================================================================================
|
||||
sed -i '/clash-watchdog.sh/d' $CRON_FILE
|
||||
sed -i '/update_all.sh/d' $CRON_FILE
|
||||
sed -i '/clash.txt/d' $CRON_FILE
|
||||
/etc/init.d/cron restart
|
||||
|
||||
@ -6,6 +6,6 @@ new_version=`wget -qO- "https://github.com/frainzy1477/luci-app-clash/tags"| gre
|
||||
if [ $new_version ]; then
|
||||
echo $new_version > /usr/share/clash/new_luci_version 2>&1 & >/dev/null
|
||||
elif [ $new_version =="" ]; then
|
||||
echo 0 > /usr/share/clash/new__luci_version 2>&1 & >/dev/null
|
||||
echo 0 > /usr/share/clash/new_luci_version 2>&1 & >/dev/null
|
||||
fi
|
||||
|
||||
@ -2,27 +2,12 @@
|
||||
|
||||
enable=$(uci get clash.config.enable 2>/dev/null)
|
||||
if [ "${enable}" -eq 1 ];then
|
||||
|
||||
|
||||
if ! pidof clash>/dev/null; then
|
||||
/etc/init.d/clash restart 2>&1 &
|
||||
fi
|
||||
|
||||
elif [ "${enable}" -eq 0 ];then
|
||||
|
||||
if [ -f /tmp/watchlist ];then
|
||||
rm -rf /tmp/watchlist
|
||||
fi
|
||||
line=$(ps | grep -n 'clash-watchdog.sh'|awk -F ':' '{print $2}' |awk -F ' ' '{print $1}'>/tmp/watchlist)
|
||||
line_no=$(grep -n '' /tmp/watchlist|awk -F ':' '{print $1}')
|
||||
num=$(grep -c '' /tmp/watchlist| awk '{print $1}')
|
||||
nums=1
|
||||
while [[ $nums -le $num ]]
|
||||
do
|
||||
kill -9 $(sed -n "$nums"p /tmp/watchlist| awk '{print $1}') >/dev/null 2>&1
|
||||
nums=$(( $nums + 1))
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -81,24 +81,6 @@ CLASHVER=$(sed -n 1p /usr/share/clash/download_core_version 2>/dev/null)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f /usr/share/clash/core_version ];then
|
||||
VER=$(rm -rf /usr/share/clash/core_version 2>/dev/null && /etc/clash/clash -v | awk -F ' ' '{print $2}' >> /usr/share/clash/core_version 2>/dev/null | sed -n 1p /usr/share/clash/core_version)
|
||||
else
|
||||
VER=0
|
||||
fi
|
||||
|
||||
if [ -f /usr/share/clash/corer_version ];then
|
||||
VERR=$(rm -rf /usr/share/clash/corer_version 2>/dev/null && /usr/bin/clash -v | awk -F ' ' '{print $2}' >> /usr/share/clash/corer_version 2>/dev/null | sed -n 1p /usr/share/clash/corer_version)
|
||||
else
|
||||
VERR=0
|
||||
fi
|
||||
|
||||
if [ -f /usr/share/clash/tun_version ];then
|
||||
VERS=$(rm -rf /usr/share/clash/tun_version 2>/dev/null && /etc/clash/clashtun/clash -v | awk -F ' ' '{print $2}' >> /usr/share/clash/tun_version | sed -n 1p /usr/share/clash/tun_version)
|
||||
else
|
||||
VERS=0
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
|
||||
update(){
|
||||
@ -199,21 +181,7 @@ update(){
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $CORETYPE -eq 1 ] && [ $VER != $CLASHVER ]; then
|
||||
if [ $CORETYPE -eq 1 ] || [ $CORETYPE -eq 2 ] || [ $CORETYPE -eq 3 ]; then
|
||||
update
|
||||
elif [ $CORETYPE -eq 2 ] && [ $VERR != $CLASHRVER ]; then
|
||||
update
|
||||
elif [ $CORETYPE -eq 3 ] && [ $VERS != $CLASHTUN ]; then
|
||||
update
|
||||
else
|
||||
if [ $lang == "zh_cn" ];then
|
||||
echo " ${LOGTIME} - 在用中是最新的内核!" >$LOG_FILE
|
||||
elif [ $lang == "en" ] || [ $lang == "auto" ];then
|
||||
echo " ${LOGTIME} - Currently using latest core" >$LOG_FILE
|
||||
fi
|
||||
sleep 2
|
||||
touch /usr/share/clash/core_down_complete >/dev/null 2>&1
|
||||
sleep 2
|
||||
rm -rf /var/run/core_update >/dev/null 2>&1
|
||||
|
||||
fi
|
||||
|
||||
|
||||
19
package/ntlf9t/luci-app-clash/root/usr/share/clash/kill_watchdog.sh
Executable file
19
package/ntlf9t/luci-app-clash/root/usr/share/clash/kill_watchdog.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
enable=$(uci get clash.config.enable 2>/dev/null)
|
||||
if [ "${enable}" -eq 0 ];then
|
||||
|
||||
if [ -f /tmp/watchlist ];then
|
||||
rm -rf /tmp/watchlist
|
||||
fi
|
||||
line=$(ps | grep -n 'clash-watchdog.sh'|awk -F ':' '{print $2}' |awk -F ' ' '{print $1}'>/tmp/watchlist)
|
||||
line_no=$(grep -n '' /tmp/watchlist|awk -F ':' '{print $1}')
|
||||
num=$(grep -c '' /tmp/watchlist| awk '{print $1}')
|
||||
nums=1
|
||||
while [[ $nums -le $num ]]
|
||||
do
|
||||
kill -9 $(sed -n "$nums"p /tmp/watchlist| awk '{print $1}') >/dev/null 2>&1
|
||||
nums=$(( $nums + 1))
|
||||
done
|
||||
fi
|
||||
|
||||
@ -1 +1 @@
|
||||
1.5.9
|
||||
1.6.0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user