v1.0.0beta1
~安装脚本细节调整 ~修改iptables规则,解决部分dns污染问题 ~优化了核心下载逻辑 ~同步最新版Geoip数据库
This commit is contained in:
BIN
bin/Country.mmdb
BIN
bin/Country.mmdb
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
GeoIP_v=20200824
|
GeoIP_v=20200827
|
||||||
versionsh=0.9.10
|
versionsh=1.0.0beta1
|
||||||
|
|||||||
10
install.sh
10
install.sh
@@ -7,16 +7,15 @@ echo "** Clash for Miwifi **"
|
|||||||
echo "** by Juewuy **"
|
echo "** by Juewuy **"
|
||||||
echo "***********************************************"
|
echo "***********************************************"
|
||||||
|
|
||||||
url="https://juewuy.xyz/clash/"
|
url="https://cdn.jsdelivr.net/gh/juewuy/clash-for-Miwifi@latest"
|
||||||
result=$(curl -w %{http_code} -skLo /tmp/clashversion $url/bin/version)
|
result=$(curl -w %{http_code} -skLo /tmp/clashversion $url/bin/version)
|
||||||
[ "$result" != "200" ] && echo "无法连接到服务器!" && exit 1
|
[ "$result" != "200" ] && echo "无法连接到服务器!" && exit 1
|
||||||
source /tmp/clashversion
|
source /tmp/clashversion
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
echo -e "~~~~版本:\033[32m$versionsh\033[0m"
|
echo -e "~~~~版本:\033[32m$versionsh\033[0m"
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
echo -e "\033[44m使用中如遇问题请加TG群反馈:\033[42;30m t.me/clashfm \033[0m"
|
echo -e "\033[44m使用中如遇问题请加TG群反馈:\033[42;30m t.me/clashfm \033[0m"
|
||||||
echo -e "\033[37m目前仅支持小米AX系列3款路由器"
|
echo -e "\033[37m支持各种基于openwrt的路由器设备"
|
||||||
echo -e "\033[44m其余型号可到TG群报名参与测试\033[0m"
|
echo -e "\033[33m有限支持debian、centos等Linux系统\033[0m"
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
echo -e "\033[32m 1 在默认目录(/etc)安装Clash for Miwifi"
|
echo -e "\033[32m 1 在默认目录(/etc)安装Clash for Miwifi"
|
||||||
echo -e "\033[33m 2 手动设置安装目录(不明勿用!)"
|
echo -e "\033[33m 2 手动设置安装目录(不明勿用!)"
|
||||||
@@ -81,6 +80,7 @@ rm -rf /tmp/clashfm.tar.gz
|
|||||||
#提示
|
#提示
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
echo clash for Miwifi 已经安装成功!
|
echo clash for Miwifi 已经安装成功!
|
||||||
echo -e "\033[33m直接输入\033[30;47m clash \033[0;33m命令即可管理!!!\033[0m"
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
echo -e "\033[33m输入\033[30;47m clash \033[0;33m命令即可管理!!!\033[0m"
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,12 @@
|
|||||||
|
|
||||||
getconfig(){
|
getconfig(){
|
||||||
#服务器地址
|
#服务器地址
|
||||||
if [ -z "$update_url" ]; then
|
[ -z "$update_url" ] && update_url=https://cdn.jsdelivr.net/gh/juewuy/clash-for-Miwifi@latest
|
||||||
update_url=https://cdn.jsdelivr.net/gh/juewuy/clash-for-Miwifi@latest
|
|
||||||
fi
|
|
||||||
#文件路径
|
#文件路径
|
||||||
if [ -z "$clashdir" ];then
|
[ -z "$clashdir" ] && clashdir=$(dirname $(readlink -f "$0")) && echo "export clashdir=\"$clashdir\"" >> /etc/profile
|
||||||
clashdir=$(dirname $(readlink -f "$0"))
|
|
||||||
echo "export clashdir=\"$clashdir\"" >> /etc/profile
|
|
||||||
fi
|
|
||||||
ccfg=$clashdir/mark
|
ccfg=$clashdir/mark
|
||||||
yaml=$clashdir/config.yaml
|
yaml=$clashdir/config.yaml
|
||||||
#检查标识文件
|
#检查/读取标识文件
|
||||||
if [ ! -f $ccfg ]; then
|
if [ ! -f $ccfg ]; then
|
||||||
echo mark文件不存在,正在创建!
|
echo mark文件不存在,正在创建!
|
||||||
cat >$ccfg<<EOF
|
cat >$ccfg<<EOF
|
||||||
@@ -69,14 +64,14 @@ if [ $status -gt 0 ];then
|
|||||||
fi
|
fi
|
||||||
echo -e "博客:\033[36;4mhttps://juewuy.xyz\033[0m,TG群:\033[36;4mhttps://t.me/clashfm\033[0m"
|
echo -e "博客:\033[36;4mhttps://juewuy.xyz\033[0m,TG群:\033[36;4mhttps://t.me/clashfm\033[0m"
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
#安装clash核心
|
#检查clash核心
|
||||||
if [ ! -f $clashdir/clash ];then
|
if [ ! -f $clashdir/clash ];then
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
echo -e "\033[31m没有找到核心文件,请先下载clash核心!\033[0m"
|
echo -e "\033[31m没有找到核心文件,请先下载clash核心!\033[0m"
|
||||||
source $clashdir/getdate.sh
|
source $clashdir/getdate.sh
|
||||||
getcore
|
getcore
|
||||||
fi
|
fi
|
||||||
#安装GeoIP数据库
|
#检查GeoIP数据库
|
||||||
if [ ! -f $clashdir/Country.mmdb ];then
|
if [ ! -f $clashdir/Country.mmdb ];then
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
echo -e "\033[31m没有找到GeoIP数据库文件,请先下载数据库!\033[0m"
|
echo -e "\033[31m没有找到GeoIP数据库文件,请先下载数据库!\033[0m"
|
||||||
@@ -590,7 +585,6 @@ update(){
|
|||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
echo -e "\033[30;47m欢迎使用更新功能:\033[0m"
|
echo -e "\033[30;47m欢迎使用更新功能:\033[0m"
|
||||||
echo -e "感谢:\033[32mClash \033[0m作者\033[36m Dreamacro\033[0m 项目地址:\033[32mhttps://github.com/Dreamacro/clash\033[0m"
|
echo -e "感谢:\033[32mClash \033[0m作者\033[36m Dreamacro\033[0m 项目地址:\033[32mhttps://github.com/Dreamacro/clash\033[0m"
|
||||||
echo -e "感谢:\033[32mClashR \033[0m作者\033[36m BROBIRD\033[0m 项目地址:\033[32mhttps://github.com/BROBIRD/clash\033[0m"
|
|
||||||
echo -e "感谢:\033[32m更多的帮助过我的人!\033[0m"
|
echo -e "感谢:\033[32m更多的帮助过我的人!\033[0m"
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
echo -e " 1 更新\033[36m管理脚本\033[0m"
|
echo -e " 1 更新\033[36m管理脚本\033[0m"
|
||||||
@@ -906,6 +900,15 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
|
|||||||
echo -e "\033[31m连接超时!请重试或检查节点配置!\033[0m"
|
echo -e "\033[31m连接超时!请重试或检查节点配置!\033[0m"
|
||||||
fi
|
fi
|
||||||
clashsh
|
clashsh
|
||||||
|
|
||||||
|
elif [[ $num == 7 ]]; then
|
||||||
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
for PID in $(ps|awk '{print $1}');do
|
||||||
|
[ -f "/proc/$PID/status" ] && vmrss=$(cat /proc/$PID/status|grep -w VmRSS|awk '{print $2}')
|
||||||
|
[ -n "$vmrss" ] && echo $vmrss $(cat /proc/$PID/status|grep -w Name|awk '{print $2}')
|
||||||
|
done
|
||||||
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
exit;
|
||||||
else
|
else
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
echo -e "\033[31m请输入正确的数字!\033[0m"
|
echo -e "\033[31m请输入正确的数字!\033[0m"
|
||||||
|
|||||||
@@ -414,9 +414,9 @@ fi
|
|||||||
clashcore_n=$clashcore
|
clashcore_n=$clashcore
|
||||||
#获取设备处理器架构
|
#获取设备处理器架构
|
||||||
cpucore=$(uname -ms | tr ' ' '_' | tr '[A-Z]' '[a-z]')
|
cpucore=$(uname -ms | tr ' ' '_' | tr '[A-Z]' '[a-z]')
|
||||||
|
[ -n "$(echo $cpucore | grep -E "linux.*armv.*")" ] && cpucore="armv5"
|
||||||
[ -n "$(echo $cpucore | grep -E "linux.*aarch64.*")" ] && cpucore="armv8"
|
[ -n "$(echo $cpucore | grep -E "linux.*aarch64.*")" ] && cpucore="armv8"
|
||||||
[ -n "$(echo $cpucore | grep -E "linux.*armv7.*")" ] && cpucore="armv7"
|
[ -n "$(echo $cpucore | grep -E "linux.*armv7.*")" ] && cpucore="armv7"
|
||||||
[ -n "$(echo $cpucore | grep -E "linux.*armv.*")" ] && cpucore="armv5"
|
|
||||||
[ -n "$(echo $cpucore | grep -E "linux.*mips.*")" ] && cpucore="mipsle-softfloat"
|
[ -n "$(echo $cpucore | grep -E "linux.*mips.*")" ] && cpucore="mipsle-softfloat"
|
||||||
[ -n "$(echo $cpucore | grep -E "linux.*x86.*")" ] && cpucore="386"
|
[ -n "$(echo $cpucore | grep -E "linux.*x86.*")" ] && cpucore="386"
|
||||||
[ -n "$(echo $cpucore | grep -E "linux.*amd64.*")" ] && cpucore="386"
|
[ -n "$(echo $cpucore | grep -E "linux.*amd64.*")" ] && cpucore="386"
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ mark_time(){
|
|||||||
start_redir(){
|
start_redir(){
|
||||||
#修改iptables规则使流量进入clash
|
#修改iptables规则使流量进入clash
|
||||||
iptables -t nat -N clash
|
iptables -t nat -N clash
|
||||||
iptables -t nat -A clash -d 0.0.0.0/8 -j RETURN
|
#iptables -t nat -A clash -d 0.0.0.0/8 -j RETURN
|
||||||
iptables -t nat -A clash -d 10.0.0.0/8 -j RETURN
|
iptables -t nat -A clash -d 10.0.0.0/8 -j RETURN
|
||||||
iptables -t nat -A clash -d 127.0.0.0/8 -j RETURN
|
iptables -t nat -A clash -d 127.0.0.0/8 -j RETURN
|
||||||
iptables -t nat -A clash -d 169.254.0.0/16 -j RETURN
|
iptables -t nat -A clash -d 169.254.0.0/16 -j RETURN
|
||||||
|
|||||||
Reference in New Issue
Block a user