Skip to content

Commit

Permalink
v1.7.0f
Browse files Browse the repository at this point in the history
~优化手动上传内核及配置文件读取,修复bug
~NTP地址替换为阿里云纯IP,以适配部分老旧设备
  • Loading branch information
juewuy committed Feb 3, 2023
1 parent ef1fd70 commit 7c07c51
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
Binary file modified bin/ShellClash.tar.gz
Binary file not shown.
Binary file modified bin/clashfm.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ clashpre_v=2022.11.25
clash_v=v1.7.1
meta_v=v1.13.2
GeoIP_v=20230128
versionsh=1.7.0e
versionsh=1.7.0f
25 changes: 17 additions & 8 deletions scripts/clash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ ckstatus(){
#检查执行权限
[ ! -x $clashdir/start.sh ] && chmod +x $clashdir/start.sh
#检查/tmp内核文件
for file in `ls -F /tmp | grep -v [/\$] | grep -iE '^clash$|^clash-linux*'` ; do
for file in `ls -F /tmp | grep -v [/\$] | grep -v '\ ' | grep -iE '^clash$|^clash-linux*'` ; do
file=/tmp/$file
chmod +x $file
tmp_version=$($file -v 2>/dev/null)
if [ -n "$tmp_version" ];then
echo -e "\033[32m发现可用的内核文件\033[0m"
echo -e "发现可用的内核文件: \033[36m$file\033[0m "
read -p "是否加载?(1/0) > " res
[ "$res" = 1 ] && {
echo -e " 1 Clash内核"
Expand All @@ -114,7 +115,7 @@ ckstatus(){
3) clashcore=clash.meta ;;
*) clashcore=clash ;;
esac
mv -f $file $bindir/clash
mv -f $file $bindir/clash && echo -e "\033[32m内核加载完成!\033[0m " && sleep 1
setconfig clashcore $clashcore
}
else
Expand All @@ -127,13 +128,21 @@ ckstatus(){
done
#检查/tmp配置文件
[ -x $bindir/clash ] && \
for file in `ls -F /tmp | grep -v [/\$] | grep -iE '.yaml$|.yml$'` ; do
for file in `ls -F /tmp | grep -v [/\$] | grep -v '\ ' | grep -iE '.yaml$|.yml$'` ; do
file=/tmp/$file
$bindir/clash -t -d $bindir -f $file &>/dev/null && {
echo -e "\033[32m发现可用的YAML配置文件\033[0m"
echo $file
echo -e "发现可用的YAML配置文件: \033[36m$file\033[0m "
read -p "加载为config.yaml配置文件/或者移除该文件?(1/0) > " res
[ "$res" = 1 ] && mv -f $file $clashdir/config.yaml
[ "$res" = 0 ] && rm -rf $file
[ "$res" = 1 ] && {
mv -f $file $clashdir/config.yaml
echo -e "\033[32m配置文件加载完成!\033[0m "
sleep 1
}
[ "$res" = 0 ] && {
rm -rf $file
echo -e "\033[32m配置文件已移除!\033[0m "
sleep 1
}
echo -----------------------------------------------
}
done
Expand Down
2 changes: 1 addition & 1 deletion scripts/init.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (C) Juewuy

version=1.7.0e
version=1.7.0f

setdir(){
dir_avail(){
Expand Down
2 changes: 1 addition & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ afstart(){
[ "$local_proxy" = "已开启" ] && [ "$local_type" = "nftables增强模式" ] && [ "$redir_mod" = "纯净模式" ] && start_nft
ckcmd iptables && start_wan
#同步本机时间
ckcmd ntpd && ntpd -n -q -p ntp.aliyun.com
ckcmd ntpd && ntpd -n -q -p 203.107.6.88
#标记启动时间
mark_time
#加载定时任务
Expand Down

0 comments on commit 7c07c51

Please sign in to comment.