diff --git a/bin/Country.mmdb b/bin/Country.mmdb index c711fefa7..b57980956 100644 Binary files a/bin/Country.mmdb and b/bin/Country.mmdb differ diff --git a/bin/clash/clash-linux-386 b/bin/clash/clash-linux-386 index e123fe127..92d2732c7 100644 Binary files a/bin/clash/clash-linux-386 and b/bin/clash/clash-linux-386 differ diff --git a/bin/clash/clash-linux-amd64 b/bin/clash/clash-linux-amd64 index 6fee69c27..4c9080d3f 100644 Binary files a/bin/clash/clash-linux-amd64 and b/bin/clash/clash-linux-amd64 differ diff --git a/bin/clash/clash-linux-armv5 b/bin/clash/clash-linux-armv5 index 603e01a93..19ba741df 100644 Binary files a/bin/clash/clash-linux-armv5 and b/bin/clash/clash-linux-armv5 differ diff --git a/bin/clash/clash-linux-armv7 b/bin/clash/clash-linux-armv7 index e09fe382e..a765f8c80 100644 Binary files a/bin/clash/clash-linux-armv7 and b/bin/clash/clash-linux-armv7 differ diff --git a/bin/clash/clash-linux-armv8 b/bin/clash/clash-linux-armv8 index cee8618e9..b816507a8 100644 Binary files a/bin/clash/clash-linux-armv8 and b/bin/clash/clash-linux-armv8 differ diff --git a/bin/clash/clash-linux-mips-softfloat b/bin/clash/clash-linux-mips-softfloat index 6f0b38eea..998450066 100644 Binary files a/bin/clash/clash-linux-mips-softfloat and b/bin/clash/clash-linux-mips-softfloat differ diff --git a/bin/clash/clash-linux-mipsle-hardfloat b/bin/clash/clash-linux-mipsle-hardfloat index e26994503..601d5f356 100644 Binary files a/bin/clash/clash-linux-mipsle-hardfloat and b/bin/clash/clash-linux-mipsle-hardfloat differ diff --git a/bin/clash/clash-linux-mipsle-softfloat b/bin/clash/clash-linux-mipsle-softfloat index 882a08ab1..dfbe81eb0 100644 Binary files a/bin/clash/clash-linux-mipsle-softfloat and b/bin/clash/clash-linux-mipsle-softfloat differ diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index e587aac10..a40278699 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/clashpre/clash-linux-386 b/bin/clashpre/clash-linux-386 index 894b20bb5..979db3c7f 100644 Binary files a/bin/clashpre/clash-linux-386 and b/bin/clashpre/clash-linux-386 differ diff --git a/bin/clashpre/clash-linux-amd64 b/bin/clashpre/clash-linux-amd64 index ad8b02248..33f7e071d 100644 Binary files a/bin/clashpre/clash-linux-amd64 and b/bin/clashpre/clash-linux-amd64 differ diff --git a/bin/clashpre/clash-linux-armv5 b/bin/clashpre/clash-linux-armv5 index 7ba8faf61..440509ea1 100644 Binary files a/bin/clashpre/clash-linux-armv5 and b/bin/clashpre/clash-linux-armv5 differ diff --git a/bin/clashpre/clash-linux-armv7 b/bin/clashpre/clash-linux-armv7 index 56e9611ba..12e4906d3 100644 Binary files a/bin/clashpre/clash-linux-armv7 and b/bin/clashpre/clash-linux-armv7 differ diff --git a/bin/clashpre/clash-linux-armv8 b/bin/clashpre/clash-linux-armv8 index 15b708272..0aa45d8f8 100644 Binary files a/bin/clashpre/clash-linux-armv8 and b/bin/clashpre/clash-linux-armv8 differ diff --git a/bin/clashpre/clash-linux-mips-softfloat b/bin/clashpre/clash-linux-mips-softfloat index a942038d2..900764819 100644 Binary files a/bin/clashpre/clash-linux-mips-softfloat and b/bin/clashpre/clash-linux-mips-softfloat differ diff --git a/bin/clashpre/clash-linux-mipsle-hardfloat b/bin/clashpre/clash-linux-mipsle-hardfloat index 5f2c44fa0..517bbb5c4 100644 Binary files a/bin/clashpre/clash-linux-mipsle-hardfloat and b/bin/clashpre/clash-linux-mipsle-hardfloat differ diff --git a/bin/clashpre/clash-linux-mipsle-softfloat b/bin/clashpre/clash-linux-mipsle-softfloat index 75a30cdd2..e8d5783db 100644 Binary files a/bin/clashpre/clash-linux-mipsle-softfloat and b/bin/clashpre/clash-linux-mipsle-softfloat differ diff --git a/bin/cn_mini.mmdb b/bin/cn_mini.mmdb index 21992cc4f..da9ec809c 100644 Binary files a/bin/cn_mini.mmdb and b/bin/cn_mini.mmdb differ diff --git a/bin/version b/bin/version index b5d8b4b5a..ddcbd336c 100644 --- a/bin/version +++ b/bin/version @@ -1,4 +1,4 @@ -clash_v=1.6.0 -clashpre_v=2021.05.08 -GeoIP_v=20210623 -versionsh=1.4.1 +GeoIP_v=20210709 +clash_v=1.6.5 +clashpre_v=2021.07.03 +versionsh=1.4.2 diff --git a/install.sh b/install.sh index 6a4e3bc0b..a23c2955e 100644 --- a/install.sh +++ b/install.sh @@ -72,6 +72,7 @@ tarurl=$url2/bin/clashfm.tar.gz gettar(){ webget /tmp/clashfm.tar.gz $tarurl [ "$result" != "200" ] && echo "文件下载失败!" && exit 1 + $clashdir/start.sh stop 2>/dev/null #解压 echo ----------------------------------------------- echo 开始解压文件! @@ -100,7 +101,7 @@ gettar(){ fi fi #修饰文件及版本号 - shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash + shtype=sh && [ -n "$(ls -l /bin/sh|grep -oE 'dash|show|bash')" ] && shtype=bash sed -i "s|/bin/sh|/bin/$shtype|" $clashdir/start.sh chmod 777 $clashdir/start.sh sed -i '/versionsh_l=*/'d $clashdir/mark diff --git a/install_n.sh b/install_n.sh deleted file mode 100644 index 6a4e3bc0b..000000000 --- a/install_n.sh +++ /dev/null @@ -1,225 +0,0 @@ -#! /bin/bash -# Copyright (C) Juewuy - -echo='echo -e' && [ -n "$(echo -e|grep e)" ] && echo=echo -#[ -z "$1" ] && test=0 || test=$1 - -echo "***********************************************" -echo "** 欢迎使用 **" -echo "** ShellClash **" -echo "** by Juewuy **" -echo "***********************************************" - -[ -f "/etc/storage/started_script.sh" ] && systype=Padavan && initdir='/etc/storage/started_script.sh' -[ -f "/jffs/.asusrouter" ] && systype=asusrouter && initdir='/jffs/.asusrouter' -#检查root权限 -if [ "$USER" != "root" -a -z "$systype" ];then - echo 当前用户:$USER - $echo "\033[31m请尽量使用root用户(不要直接使用sudo命令!)执行安装!\033[0m" - echo ----------------------------------------------- - read -p "仍要安装?可能会产生未知错误!(1/0) > " res - [ "$res" != "1" ] && exit 1 -fi -webget(){ - #参数【$1】代表下载目录,【$2】代表在线地址 - #参数【$3】代表输出显示,【$4】不启用重定向 - if curl --version > /dev/null 2>&1;then - [ "$3" = "echooff" ] && progress='-s' || progress='-#' - [ -z "$4" ] && redirect='-L' || redirect='' - result=$(curl -w %{http_code} --connect-timeout 5 $progress $redirect -ko $1 $2) - else - if wget --version > /dev/null 2>&1;then - [ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress' - [ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect='' - certificate='--no-check-certificate' - timeout='--timeout=3' - fi - [ "$3" = "echoon" ] && progress='' - [ "$3" = "echooff" ] && progress='-q' - wget $progress $redirect $certificate $timeout -O $1 $2 - [ $? -eq 0 ] && result="200" - fi -} -#检查更新 -[ -z "$url" ] && url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash" -#选择版本 -echo ----------------------------------------------- -$echo "\033[33m请选择想要安装的版本:\033[0m" -$echo " 1 \033[32mShellclash正式版\033[0m" -$echo " 2 \033[31mShellclash测试版\033[0m" -echo ----------------------------------------------- -read -p "请输入相应数字 > " num -if [ -z $num ];then - echo 安装已取消 - exit 1; -elif [ "$num" = "1" ];then - webget /tmp/clashrelease $url/bin/release_version echoon rediroff 2>/tmp/clashrelease - if [ "$result" = "200" ];then - release_new=$(cat /tmp/clashrelease | head -1) - url2="https://cdn.jsdelivr.net/gh/juewuy/ShellClash@$release_new" - else - echo "无法切换版本,尝试安装测试版!" - fi -fi -[ -z "$url2" ] && url2=$url -webget /tmp/clashversion "$url2/bin/version" echooff -[ "$result" = "200" ] && versionsh=$(cat /tmp/clashversion | grep "versionsh" | awk -F "=" '{print $2}') -[ -z "$release_new" ] && release_new=$versionsh -rm -rf /tmp/clashversion -rm -rf /tmp/clashrelease -tarurl=$url2/bin/clashfm.tar.gz - -gettar(){ - webget /tmp/clashfm.tar.gz $tarurl - [ "$result" != "200" ] && echo "文件下载失败!" && exit 1 - #解压 - echo ----------------------------------------------- - echo 开始解压文件! - mkdir -p $clashdir > /dev/null - tar -zxvf '/tmp/clashfm.tar.gz' -C $clashdir/ - [ $? -ne 0 ] && echo "文件解压失败!" && rm -rf /tmp/clashfm.tar.gz && exit 1 - #初始化文件目录 - [ -f "$clashdir/mark" ] || echo '#标识clash运行状态的文件,不明勿动!' > $clashdir/mark - #判断系统类型写入不同的启动文件 - if [ -f /etc/rc.common ];then - #设为init.d方式启动 - mv $clashdir/clashservice /etc/init.d/clash - chmod 777 /etc/init.d/clash - else - [ -w /etc/systemd/system ] && sysdir=/etc/systemd/system - [ -w /usr/lib/systemd/system ] && sysdir=/usr/lib/systemd/system - if [ -n "$sysdir" ];then - #设为systemd方式启动 - mv $clashdir/clash.service $sysdir/clash.service - sed -i "s%/etc/clash%$clashdir%g" $sysdir/clash.service - systemctl daemon-reload - else - #设为保守模式启动 - sed -i '/start_old=*/'d $clashdir/mark - echo start_old=已开启 >> $clashdir/mark - fi - fi - #修饰文件及版本号 - shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash - sed -i "s|/bin/sh|/bin/$shtype|" $clashdir/start.sh - chmod 777 $clashdir/start.sh - sed -i '/versionsh_l=*/'d $clashdir/mark - echo versionsh_l=$release_new >> $clashdir/mark - #设置更新地址 - sed -i '/update_url=*/'d $clashdir/mark - echo update_url=$url >> $clashdir/mark - #设置环境变量 - [ -w /opt/etc/profile ] && profile=/opt/etc/profile - [ -w /jffs/configs/profile.add ] && profile=/jffs/configs/profile.add - [ -w ~/.bashrc ] && profile=~/.bashrc - [ -w /etc/profile ] && profile=/etc/profile - if [ -n "$profile" ];then - sed -i '/alias clash=*/'d $profile - echo "alias clash=\"$shtype $clashdir/clash.sh\"" >> $profile #设置快捷命令环境变量 - sed -i '/export clashdir=*/'d $profile - echo "export clashdir=\"$clashdir\"" >> $profile #设置clash路径环境变量 - else - echo 无法写入环境变量!请检查安装权限! - exit 1 - fi - #华硕/Padavan额外设置 - [ -n "$systype" ] && sed -i '/ShellClash初始化/'d $initdir && echo "$clashdir/start.sh init #ShellClash初始化脚本" >> $initdir - #删除临时文件 - rm -rf /tmp/clashfm.tar.gz - rm -rf $clashdir/clashservice - rm -rf $clashdir/clash.service -} -#下载及安装 -install(){ -echo ----------------------------------------------- -echo 开始从服务器获取安装文件! -echo ----------------------------------------------- -gettar -echo ----------------------------------------------- -echo ShellClash 已经安装成功! -[ "$profile" = "~/.bashrc" ] && echo "请执行【source ~/.bashrc &> /dev/null】命令以加载环境变量!" -echo ----------------------------------------------- -$echo "\033[33m输入\033[30;47m clash \033[0;33m命令即可管理!!!\033[0m" -echo ----------------------------------------------- -} -setdir(){ -if [ -n "$systype" ];then - [ "$systype" = "Padavan" ] && dir=/etc/storage - [ "$systype" = "asusrouter" ] && dir=/jffs -else - echo ----------------------------------------------- - $echo "\033[33m安装ShellClash至少需要预留约1MB的磁盘空间\033[0m" - $echo " 1 在\033[32m/etc目录\033[0m下安装(适合root用户)" - $echo " 2 在\033[32m/usr/share目录\033[0m下安装(适合Linux设备)" - $echo " 3 在\033[32m当前用户目录\033[0m下安装(适合非root用户)" - $echo " 4 手动设置安装目录" - $echo " 0 退出安装" - echo ----------------------------------------------- - read -p "请输入相应数字 > " num - #设置目录 - if [ -z $num ];then - echo 安装已取消 - exit 1; - elif [ "$num" = "1" ];then - dir=/etc - elif [ "$num" = "2" ];then - dir=/usr/share - elif [ "$num" = "3" ];then - dir=~/.local/share - mkdir -p ~/.config/systemd/user - elif [ "$num" = "4" ];then - echo ----------------------------------------------- - echo '可用路径 剩余空间:' - df -h | awk '{print $6,$4}'| sed 1d - echo '路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!' - read -p "请输入自定义路径 > " dir - if [ -z "$dir" ];then - $echo "\033[31m路径错误!请重新设置!\033[0m" - setdir - fi - else - echo 安装已取消!!! - exit 1; - fi -fi -if [ ! -w $dir ];then - $echo "\033[31m没有$dir目录写入权限!请重新设置!\033[0m" && sleep 1 && setdir -else - $echo "目标目录\033[32m$dir\033[0m空间剩余:$(df -h $dir | awk '{print $4}' | sed 1d )" - read -p "确认安装?(1/0) > " res - [ "$res" = "1" ] && clashdir=$dir/clash || setdir -fi -} - -#输出 -$echo "最新版本:\033[32m$release_new\033[0m" -echo ----------------------------------------------- -$echo "\033[44m如遇问题请加TG群反馈:\033[42;30m t.me/clashfm \033[0m" -$echo "\033[37m支持各种基于openwrt的路由器设备" -$echo "\033[33m支持Debian、Centos等标准Linux系统\033[0m" - -if [ -n "$clashdir" ];then - echo ----------------------------------------------- - $echo "检测到旧的安装目录\033[36m$clashdir\033[0m,是否覆盖安装?" - $echo "\033[32m覆盖安装时不会移除配置文件!\033[0m" - read -p "覆盖安装/卸载旧版本?(1/0) > " res - if [ "$res" = "1" ];then - install - elif [ "$res" = "0" ];then - rm -rf $clashdir - echo ----------------------------------------------- - $echo "\033[31m 旧版本文件已卸载!\033[0m" - setdir - install - elif [ "$res" = "9" ];then - echo 测试模式,变更安装位置 - setdir - install - else - $echo "\033[31m输入错误!已取消安装!\033[0m" - exit 1; - fi -else - setdir - install -fi diff --git a/scripts/clash.sh b/scripts/clash.sh index 2ab82c141..5a32f84f6 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -544,7 +544,7 @@ clashcfg(){ echo -e "\033[36mTun及混合模式必须使用clashpre核心!\033[0m" echo ----------------------------------------------- echo -e " 1 Redir模式:CPU以及内存\033[33m占用较低\033[0m" - echo -e " 但\033[31m不支持UDP\033[0m,不支持fake-ip模式" + echo -e " 但\033[31m不支持UDP\033[0m" echo -e " 适合\033[32m非外服游戏用户\033[0m使用" echo -e " 2 混合模式: 使用redir转发TCP,Tun转发UDP流量" echo -e " \033[33m速度较快\033[0m,\033[31m内存占用略高\033[0m" @@ -619,7 +619,7 @@ clashcfg(){ echo -e "\033[33m切换模式后需要手动重启clash服务以生效!\033[0m" echo ----------------------------------------------- echo -e " 1 fake-ip模式: \033[32m响应速度更快\033[0m" - echo -e " 不支持Redir模式,兼容性略差" + echo -e " 兼容性比较差,部分应用可能打不开" echo -e " 2 redir_host模式:\033[32m兼容性更好\033[0m" echo -e " 不支持Tun模式,抗污染能力略差" echo " 0 返回上级菜单" @@ -629,15 +629,20 @@ clashcfg(){ elif [ "$num" = 0 ]; then i= elif [ "$num" = 1 ]; then - if [ "$redir_mod" = "Redir模式" ];then - echo ----------------------------------------------- - echo -e "\033[36mfake-ip与Redir模式兼容性较差,请使用其他模式!!\033[0m" - else + set_fake_ip(){ dns_mod=fake-ip setconfig dns_mod $dns_mod echo ----------------------------------------------- echo -e "\033[36m已设为 $dns_mod 模式!!\033[0m" + } + if [ "$redir_mod" = "Redir模式" ];then + echo ----------------------------------------------- + read -p "fake-ip与Redir模式兼容性较差,是否依然强制使用?(1/0) > " res + [ "$res" = 1 ] && set_fake_ip + else + set_fake_ip fi + elif [ "$num" = 2 ]; then dns_mod=redir_host setconfig dns_mod $dns_mod diff --git a/scripts/clashservice b/scripts/clashservice index 745210d43..da9a3d87f 100644 --- a/scripts/clashservice +++ b/scripts/clashservice @@ -1,6 +1,6 @@ #!/bin/sh /etc/rc.common -START=101 +START=99 SERVICE_DAEMONIZE=1 SERVICE_WRITE_PID=1 diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 531b9f782..318e12347 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -308,6 +308,7 @@ clashlink(){ gettar(){ $clashdir/start.sh webget /tmp/clashfm.tar.gz $tarurl [ "$?" = "1" ] && echo "文件下载失败!" && exit 1 + $clashdir/start.sh stop #解压 echo ----------------------------------------------- echo 开始解压文件! @@ -336,7 +337,7 @@ gettar(){ fi fi #修饰文件及版本号 - shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash + shtype=sh && [ -n "$(ls -l /bin/sh|grep -oE 'dash|show|bash')" ] && shtype=bash sed -i "s|/bin/sh|/bin/$shtype|" $clashdir/start.sh chmod 777 $clashdir/start.sh sed -i '/versionsh_l=*/'d $clashdir/mark @@ -366,6 +367,7 @@ getsh(){ echo ----------------------------------------------- echo -e "当前脚本版本为:\033[33m $versionsh_l \033[0m" echo -e "最新脚本版本为:\033[32m $release_new \033[0m" + echo -e "注意更新时会停止clash服务!" echo ----------------------------------------------- read -p "是否更新脚本?[1/0] > " res if [ "$res" = '1' ]; then