16 Commits
1.1.0 ... 1.2.0

Author SHA1 Message Date
juewuy
e4ce1e48f8 v1.2.0-release
~新增自定义本机host地址的功能(7-6-8)
~新手引导流程中新增自动设置加密DNS功能(当检测到本地证书时自动配置)
~优化了合并自定义配置文件的流程,现在会在生成的规则中添加注释
~同步最新1.4.2版本官方核心及高级版核心
~同步最新数据库文件
~修复yacd面板无法自动配置host的问题
~修复部分情况下检测本机host失败的bug
~修复部分情况下导入包含“&”符号的配置文件失败的bug
~修复在导入包含“/”的自定义规则时报错的bug
2021-03-23 17:46:48 +08:00
juewuy
5153ca84e1 v1.1.8-test
~新增自定义本机host地址的功能(7-6-8)
~屏蔽核心自带的节点保存功能(会占用更多空间)
~修复部分情况下检测本机host失败的bug
~修复部分情况下导入包含“&”符号的配置文件失败的bug
~修复Debian等默认使用dash的系统下运行出错的bug
2021-03-20 18:05:20 +08:00
juewuy
7acac3c6e9 v1.1.7-test
~新增自定义本机host地址的功能(7-6-8)
~屏蔽核心自带的节点保存功能(会占用更多空间)
~修复部分情况下检测本机host失败的bug
~修复部分情况下导入配置文件失败的bug
~修复Debian等默认使用dash的系统下运行出错的bug
2021-03-19 22:03:09 +08:00
juewuy
f6eb1577af v1.1.6-test
~新增自定义本机host地址的功能(7-6-8)
~屏蔽核心自带的节点保存功能(会占用更多空间)
~修复部分情况下检测本机host失败的bug
~修复部分情况下导入配置文件失败的bug
2021-03-19 21:36:48 +08:00
juewuy
30b98f7f64 v1.1.6-test
~新增自定义本机host地址的功能(7-6-8)
~屏蔽核心自带的节点保存功能(会占用更多空间)
~修复部分情况下检测本机host失败的bug
~修复部分情况下导入配置文件失败的bug
2021-03-19 21:30:53 +08:00
juewuy
925c4644bb v1.1.6-test
~新增自定义本机host地址的功能(7-6-8)
~修复部分情况下检测本机host失败的bug
~修复部分情况下导入配置文件失败的bug
2021-03-19 17:55:41 +08:00
juewuy
4d7bd92381 v1.1.6-test
~新增自定义本机host地址的功能(7-6-8)
~修复部分情况下检测本机host失败的bug
~修复部分情况下导入配置文件失败的bug
2021-03-19 17:55:20 +08:00
juewuy
6129b69588 v1.1.6-test
~修复部分情况下检测本机host失败的bug
2021-03-13 19:28:32 +08:00
juewuy
47c938568e v1.1.5-test
~新手引导流程中新增自动设置加密DNS功能(当检测到本地证书时自动配置)
~优化了合并自定义配置文件的流程,现在会在生成的规则中添加注释
~同步最新1.4.2版本官方核心及高级版核心
~同步最新Dashboard面板及数据库文件
~修复yacd面板无法自动配置host的问题
~修复部分描述错误
2021-03-13 19:08:47 +08:00
juewuy
2328ed9616 v1.1.5-test
~新手引导流程中新增自动设置加密DNS功能(当检测到本地证书时自动配置)
~优化了合并自定义配置文件的流程,现在会在生成的规则中添加注释
~同步最新1.4.2版本官方核心及高级版核心
~同步最新Dashboard面板及数据库文件
~修复部分描述错误
2021-03-13 18:06:38 +08:00
juewuy
0b6e84d767 v1.1.5-test
~修复部分描述错误
2021-02-28 12:41:29 +08:00
juewuy
b4fdcf8a27 v1.1.4-test
~修复部分情况下iptables报错的bug
~修复部分情况下保持面板配置时报错的bug
2021-02-25 21:16:36 +08:00
juewuy
36fcc884d6 v1.1.4-test
~修复部分情况下iptables报错的bug
2021-02-25 15:14:36 +08:00
juewuy
1d1098b166 v1.1.3-test
~同步官方最新版本1.4.1核心
~同步最新dashboard面板
~同步最新Geoip数据库
2021-02-21 14:41:37 +08:00
juewuy
03dd3654b7 v1.1.2-test
~同步官方最新版本1.4.0核心
~同步最新dashboard面板
~同步最新Geoip数据库
2021-02-20 15:38:28 +08:00
juewuy
e668551fd0 v1.1.1-test
~修复在导入包含“/”的自定义规则时报错的bug
2021-02-18 19:00:31 +08:00
27 changed files with 63 additions and 24 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View File

@@ -1,3 +1,4 @@
1.2.0
1.1.0
1.0.0beta18.2
1.0.0beta17

View File

@@ -1,4 +1,4 @@
clash_v=1.3.5
clashpre_v=2020.12.27
versionsh=1.1.0
GeoIP_v=20210210
clash_v=1.4.2
clashpre_v=2021.03.10
GeoIP_v=20210322
versionsh=1.2.0

Binary file not shown.

View File

@@ -86,7 +86,7 @@ gettar(){
fi
#修饰文件及版本号
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
sed -i "s%#!/bin/sh%#!/bin/$shtype%g" $clashdir/start.sh
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

View File

@@ -27,8 +27,8 @@ getconfig(){
#检查mac地址记录
[ ! -f $clashdir/mac ] && touch $clashdir/mac
#获取本机host地址
host=$(ubus call network.interface.lan status 2>&1 | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';)
[ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '192.|10.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1)
[ -z "$host" ] && host=$(ubus call network.interface.lan status 2>&1 | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';)
[ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '\ 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1)
[ -z "$host" ] && host=127.0.0.1
#dashboard目录位置
[ -d $clashdir/ui ] && dbdir=$clashdir/ui && hostdir=":$db_port/ui"
@@ -93,7 +93,7 @@ getconfig(){
setconfig(){
#参数1代表变量名参数2代表变量值,参数3即文件路径
[ -z "$3" ] && configpath=$clashdir/mark || configpath=$3
[ -n "$(grep ${1} $configpath)" ] && sed -i "s#${1}=.*#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath
[ -n "$(grep ${1} $configpath)" ] && sed -i "s#${1}=\(.*\)#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath
}
#启动相关
errornum(){
@@ -166,6 +166,7 @@ setport(){
echo -e " 5 修改面板访问端口: \033[36m$db_port\033[0m"
echo -e " 6 设置面板访问密码: \033[36m$secret\033[0m"
echo -e " 7 修改默认端口过滤: \033[36m$multiport\033[0m"
echo -e " 8 指定本机host地址 \033[36m$host\033[0m"
echo -e " 0 返回上级菜单"
read -p "请输入对应数字 > " num
if [ -z "$num" ]; then
@@ -233,6 +234,26 @@ setport(){
echo -e "\033[32m设置成功\033[0m"
fi
setport
elif [ "$num" = 8 ]; then
echo -----------------------------------------------
echo -e "\033[33m此处可以更改脚本内置的host地址\033[0m"
echo -e "\033[31m设置后如本机host地址有变动请务必手动修改\033[0m"
echo -----------------------------------------------
read -p "请输入自定义host地址(输入0移除自定义host) > " host
if [ "$host" = "0" ];then
host=""
setconfig host $host
echo -e "\033[32m已经移除自定义host地址请重新运行脚本以自动获取host\033[0m"
exit 0
elif [ -n "$(echo $host | grep -Po '(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])(\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)){3}')" ]; then
setconfig host $host
echo -e "\033[32m设置成功\033[0m"
else
host=""
echo -e "\033[31m输入错误请仔细核对\033[0m"
fi
sleep 1
setport
fi
}
setdns(){
@@ -521,7 +542,7 @@ clashcfg(){
echo -e " 1 Redir模式CPU以及内存\033[33m占用较低\033[0m"
echo -e " 但\033[31m不支持UDP\033[0m流量转发"
echo -e " 适合\033[32m非游戏用户\033[0m使用"
echo -e " 2 混合模式: 使用redir转发TCPTun转发UPD"
echo -e " 2 混合模式: 使用redir转发TCPTun转发UDP流量"
echo -e " \033[33m速度较快\033[0m\033[31m内存占用略高\033[0m"
echo -e " 适合\033[32m游戏用户、综合用户\033[0m"
echo -e " 3 Tun模式 \033[33m支持UDP转发\033[0m且延迟最低"
@@ -719,7 +740,7 @@ clashadv(){
echo -e " 3 Redir模式udp转发: \033[36m$tproxy_mod\033[0m ————依赖iptables-mod-tproxy"
echo -e " 4 启用小闪存模式: \033[36m$mini_clash\033[0m ————启动时方下载核心及数据库文件"
echo -e " 5 配置内置DNS服务 \033[36m$dns_no\033[0m"
echo -e " 6 手动指定相关服务端口秘钥"
echo -e " 6 手动指定相关端口秘钥及本机host"
echo -e " 7 使用自定义配置"
echo -----------------------------------------------
echo -e " 8 \033[31m重置\033[0m配置文件"

View File

@@ -217,6 +217,7 @@ getlink2(){
read -p "请输入完整链接 > " link
test=$(echo $link | grep -iE "tp.*://" )
link=`echo ${link/\ \(*\)/''}` #删除恶心的超链接内容
link=`echo ${link//\&/\\\&}` #为分隔符 & 添加转义
if [ -n "$link" -a -n "$test" ];then
echo -----------------------------------------------
echo -e 请检查输入的链接是否正确:
@@ -363,17 +364,22 @@ gettar(){
fi
#修饰文件及版本号
shtype=sh && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && shtype=bash
sed -i "s%#!/bin/sh%#!/bin/$shtype%g" $clashdir/start.sh
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
#设置环境变量
[ -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
#删除临时文件
rm -rf /tmp/clashfm.tar.gz
rm -rf $clashdir/clashservice
@@ -560,7 +566,7 @@ getdb(){
sed -i "s/127.0.0.1/${host}/g" $dbdir/assets/*.js
sed -i "s/9090/${db_port}/g" $dbdir/assets/*.js
else
sed -i "s/127.0.0.1:9090/${host}:${db_port}/g" $dbdir/app*.js
sed -i "s/127.0.0.1:9090/${host}:${db_port}/g" $dbdir/*.html
#sed -i "s/7892/${db_port}/g" $dbdir/app*.js
fi
#如果clash在运行则重启clash服务
@@ -932,6 +938,15 @@ userguide(){
read -p "是否下载并安装根证书?(1/0) > " res
[ "$res" = 1 ] && checkupdate && getcrt
fi
#设置加密DNS
webget /tmp/ssl_test https://baidu.com echooff rediron skipceroff
if [ "$result" = "200" ];then
dns_nameserver='https://223.5.5.5/dns-query, https://doh.pub/dns-query, tls://dns.rubyfish.cn:853'
dns_fallback='https://1.0.0.1/dns-query, https://8.8.4.4/dns-query, https://doh.opendns.com/dns-query'
setconfig dns_nameserver \'"$dns_nameserver"\'
setconfig dns_fallback \'"$dns_fallback"\'
fi
rm -rf /tmp/ssl_test
#提示导入订阅或者配置文件
echo -----------------------------------------------
echo -e "\033[32m是否导入配置文件\033[0m(这是运行前的最后一步)"

View File

@@ -90,9 +90,9 @@ mark_time(){
echo start_time=$start_time >> $clashdir/mark
}
gethost(){
host=$(ubus call network.interface.lan status 2>&1 | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';)
[ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '192.|10.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1)
[ -n "$host" ] && lanhost="-s $(echo $host | grep -oE '192.|10.')0.0.0/8"
[ -z "$host" ] && host=$(ubus call network.interface.lan status 2>&1 | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';)
[ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E '\ 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1)
[ -n "$host" ] && lanhost="-s $(echo $host | grep -oE '^1(92|0|72)\.')0.0.0/8"
}
#配置文件相关
getyaml(){
@@ -166,7 +166,7 @@ EOF`
else
Https=""
#检测节点或providers
if [ -z "$(cat $yamlnew | grep -E 'server:|proxy-providers:' | grep -v 'nameserver')" ];then
if [ -z "$(cat $yamlnew | grep -E 'server:|proxy-providers:' | grep -v 'nameserver' | head -n 1)" ];then
echo -----------------------------------------------
logger "获取到了配置文件,但似乎并不包含正确的节点信息!" 31
echo -----------------------------------------------
@@ -264,18 +264,20 @@ secret: $secret
$tun
$exper
$dns
store-selected: false
EOF
###################################
[ -f $clashdir/user.yaml ] && yaml_user=$clashdir/user.yaml
#合并文件
cut -c 1- $tmpdir/set.yaml $yaml_user $tmpdir/proxy.yaml > $tmpdir/config.yaml
#插入自定义规则
sed -i "/#自定义规则/d" $tmpdir/config.yaml
if [ -f $clashdir/rules.yaml ];then
while read line;do
[ -z "$(echo "$line " | grep '#')" ] && \
[ -n "$(echo "$line" | grep '\-\ ')" ] && \
sed -i "/$line/d" $tmpdir/config.yaml && \
sed -i "/^rules:/a\ $line" $tmpdir/config.yaml
line=$(echo "$line" | sed 's#/#\\/#') && \
sed -i "/^rules:/a\ $line #自定义规则" $tmpdir/config.yaml
done < $clashdir/rules.yaml
fi
#如果没有使用小闪存模式
@@ -452,7 +454,7 @@ web_save(){
#使用get_save获取面板节点设置
get_save http://localhost:${db_port}/proxies | awk -F "{" '{for(i=1;i<=NF;i++) print $i}' | grep -E '^"all".*"Selector"' > /tmp/clash_web_check_$USER
while read line ;do
def=$(echo $line | awk -F "[\[,]" '{print $2}')
def=$(echo $line | awk -F "[[,]" '{print $2}')
now=$(echo $line | grep -oE '"now".*",' | sed 's/"now"://g'| sed 's/,//g')
[ "$def" != "$now" ] && echo $line | grep -oE '"name".*"now".*",' | sed 's/"name"://g' | sed 's/"now"://g'| sed 's/"//g' >> /tmp/clash_web_save_$USER
done < /tmp/clash_web_check_$USER