v1.0.0beta14fix5
~优化节点保存方式,现在每10分钟检测一次,仅在检测到文件变动后方进行保存 ~修复部分ssr节点不可用的bug ~mac过滤功能增加移除单个设备以及添加全部设备功能 ~修复设置本机代理时直接跳出的bug ~优化安装脚本,增加root用户检测 ~优化ipv6dns拦截方式 ~回滚对循环计算的方式
This commit is contained in:
@@ -62,9 +62,9 @@ if [ -n "$PID" ];then
|
||||
VmRSS=`cat /proc/$PID/status|grep -w VmRSS|awk '{print $2,$3}'`
|
||||
#获取运行时长
|
||||
if [ -n "$start_time" ]; then
|
||||
time=$(expr `date +%s` - $start_time)
|
||||
#day=$(($time/86400))
|
||||
day=$(expr $time / 86400)
|
||||
time=$((`date +%s`-start_time))
|
||||
day=$((time/86400))
|
||||
#day=$(expr $time / 86400)
|
||||
if [ "$day" = "0" ]; then
|
||||
day=""
|
||||
else
|
||||
@@ -386,7 +386,7 @@ macfilter(){
|
||||
i=1
|
||||
for mac in $(cat $clashdir/mac); do
|
||||
echo -e " $i \033[32m$(cat /tmp/dhcp.leases | awk '{print $3,$2,$4}' | grep $mac)\033[0m"
|
||||
i=$(expr $i + 1)
|
||||
i=$((i+1))
|
||||
done
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[0m 0 或回车 结束删除"
|
||||
|
||||
@@ -173,7 +173,7 @@ do
|
||||
else
|
||||
Url="$Url"\|"$url"
|
||||
fi
|
||||
i=$(expr $i + 1)
|
||||
i=$((i+1))
|
||||
elif [ -z "$url" ];then
|
||||
[ -n "$Url" ] && linkset
|
||||
elif [[ $url == 0 ]];then
|
||||
|
||||
@@ -82,14 +82,14 @@ if [ "$result" != "200" ];then
|
||||
echo -e "\033[32m无法获取配置文件,请检查链接格式以及网络连接状态!\033[0m"
|
||||
exit 1
|
||||
else
|
||||
retry=$(expr $retry + 1)
|
||||
retry=$((retry+1))
|
||||
echo -e "\033[32m尝试使用其他服务器获取配置!\033[0m"
|
||||
echo -e "\033[33m正在尝试第$retry次/共5次!\033[0m"
|
||||
sed -i '/server_link=*/'d $ccfg
|
||||
if [ "$server_link" -ge 5 ]; then
|
||||
server_link=0
|
||||
fi
|
||||
server_link=$(expr $server_link + 1)
|
||||
server_link=$((server_link+1))
|
||||
sed -i "1i\server_link=$server_link" $ccfg
|
||||
Https=""
|
||||
getyaml
|
||||
@@ -172,7 +172,7 @@ fi
|
||||
yaml=$clashdir/config.yaml
|
||||
#预删除需要添加的项目
|
||||
i=$(grep -n "^proxies:" $clashdir/config.yaml | head -1 | cut -d ":" -f 1)
|
||||
i=$(expr $i - 1)
|
||||
i=$((i-1))
|
||||
sed -i "1,${i}d" $yaml
|
||||
#添加配置
|
||||
sed -i "1imixed-port:\ $mix_port" $yaml
|
||||
@@ -217,7 +217,7 @@ start_redir(){
|
||||
iptables -t nat -A clash -p tcp $ports-j REDIRECT --to-ports $redir_port
|
||||
iptables -t nat -A PREROUTING -p tcp -j clash
|
||||
#设置ipv6转发
|
||||
if [ "$ipv6_support" = "已开启" ];then
|
||||
if [ -n "ip6_nat" -a "$ipv6_support" = "已开启" ];then
|
||||
ip6tables -t nat -N clashv6
|
||||
for mac in $(cat $clashdir/mac); do
|
||||
ip6tables -t nat -A clashv6 -m mac --mac-source $mac -j RETURN
|
||||
@@ -264,8 +264,8 @@ start_dns(){
|
||||
iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j clash_dns
|
||||
iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j clash_dns
|
||||
#ipv6DNS
|
||||
ip6_nat=$(ip6tables -t nat -L 2>&1|grep -o 'not exist')
|
||||
if [ -z "ip6_nat" ];then
|
||||
ip6_nat=$(ip6tables -t nat -L 2>&1|grep -o 'Chain')
|
||||
if [ -n "ip6_nat" ];then
|
||||
ip6tables -t nat -N clashv6_dns > /dev/null 2>&1
|
||||
for mac in $(cat $clashdir/mac); do
|
||||
ip6tables -t nat -A clashv6_dns -m mac --mac-source $mac -j RETURN > /dev/null 2>&1
|
||||
|
||||
Reference in New Issue
Block a user