~替换自建源与自建Sub服务器域名
~修复/tmp目录检测到多个内核或配置文件时跳出的bug
~其他提示相关修复及优化
This commit is contained in:
juewuy 2023-02-01 10:13:35 +08:00
parent c9227d9c36
commit e98a113b2f
9 changed files with 34 additions and 26 deletions

View File

@ -56,7 +56,7 @@ export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q
或者
```shell
sudo -i #切换到root用户,如果需要密码,请输入密码
export url='https://gh.shellclash.cf/master' && bash -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
export url='https://gh.jwsc.eu.org/master' && bash -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
```
~**路由设备使用curl安装**<br>
@ -73,7 +73,7 @@ export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$
或者
```shell
#作者私人源
export url='https://gh.shellclash.cf/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
export url='https://gh.jwsc.eu.org/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
```
~**路由设备使用wget安装**<br>
@ -92,7 +92,7 @@ export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q
```Shell
#作者私人http内测源
export url='http://test.shellclash.cf' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
export url='http://t.jwsc.eu.org' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null
```
~**DOCKER环境下安装**<br>

Binary file not shown.

Binary file not shown.

View File

@ -2,5 +2,5 @@ clashnet_v=v1.7.6
clashpre_v=2022.11.25
clash_v=v1.7.1
meta_v=v1.13.2
versionsh=1.7.0b
GeoIP_v=20230128
versionsh=1.7.0d

View File

@ -62,7 +62,7 @@ gettar(){
error_down
exit 1
else
source $clashdir/init.sh 2>/dev/null
source $clashdir/init.sh >/dev/null
fi
fi
}

View File

@ -98,8 +98,9 @@ ckstatus(){
#检查执行权限
[ ! -x $clashdir/start.sh ] && chmod +x $clashdir/start.sh
#检查/tmp内核文件
[ -f /tmp/clash*linux* ] && chmod +x /tmp/clash*linux* && {
tmp_version=$(/tmp/clash*linux* -v)
for file in /tmp/clash*linux* ; do
chmod +x $file
tmp_version=$($file -v)
if [ -n "$tmp_version" ];then
echo -e "\033[32m发现可用的内核文件\033[0m"
read -p "是否加载?(1/0) > " res
@ -113,27 +114,29 @@ ckstatus(){
3) clashcore=clash.meta ;;
*) clashcore=clash ;;
esac
mv -f /tmp/clash*linux* $bindir/clash
mv -f $file $bindir/clash
setconfig clashcore $clashcore
}
else
echo -e "\033[33m检测到不可用的内核文件可能是文件受损或CPU架构不匹配\033[0m"
rm -rf /tmp/clash*linux*
rm -rf $file
echo -e "\033[33m内核文件已移除请认真检查后重新上传\033[0m"
sleep 3
sleep 2
fi
echo -----------------------------------------------
}
done
#检查/tmp配置文件
[ -f /tmp/*.*ml -a -x $bindir/clash ] && $bindir/clash -t -d $bindir -f /tmp/*.*ml &>/dev/null && {
[ -x $bindir/clash ] && \
for file in /tmp/clash*linux* ; do
$bindir/clash -t -d $bindir -f $file &>/dev/null && {
echo -e "\033[32m发现可用的YAML配置文件\033[0m"
echo /tmp/*.*ml
echo $file
read -p "是否加载为config.yaml配置文件(1/0) > " res
[ "$res" = 1 ] && {
mv -f /tmp/*.*ml $clashdir/config.yaml
mv -f $file $clashdir/config.yaml
}
echo -----------------------------------------------
}
done
}
#启动相关
@ -669,7 +672,7 @@ macfilter(){
echo -e "\033[31m已添加的设备请勿重复添加\033[0m"
fi
add_mac
elif [ $num -le $(cat $dhcpdir | awk 'END{print NR}') 2>/dev/null ]; then
elif [ $num -le $(cat $dhcpdir 2>/dev/null | awk 'END{print NR}') ]; then
macadd=$(cat $dhcpdir | awk '{print $2}' | sed -n "$num"p)
if [ -z "$(cat $clashdir/mac | grep -E "$macadd")" ];then
echo $macadd >> $clashdir/mac
@ -1039,6 +1042,10 @@ clashcfg(){
set_redir_config
elif [ "$num" = 2 ]; then
modprobe tun &>/dev/null || {
echo -e "\033[32m设备未检测到Tun模块可能无法代理UDP流量\033[0m"
sleep 1
}
redir_mod=混合模式
set_redir_config

View File

@ -758,7 +758,7 @@ setserver(){
release_url=''
saveserver
elif [ "$num" = 4 ]; then
update_url='https://gh.shellclash.cf/master'
update_url='https://gh.jwsc.eu.org/master'
release_url=''
saveserver
elif [ "$num" = 5 ]; then
@ -770,7 +770,7 @@ setserver(){
release_url=''
saveserver
elif [ "$num" = 7 ]; then
update_url='http://test.shellclash.cf'
update_url='http://t.jwsc.eu.org'
release_url=''
saveserver
elif [ "$num" = 8 ]; then
@ -793,7 +793,7 @@ setserver(){
read -p "请输入对应数字 > " num
if [ -z "$num" -o "$num" = 0 ]; then
setserver
elif [ $num -le $(cat /tmp/clashrelease | awk 'END{print NR}') 2>/dev/null ]; then
elif [ $num -le $(cat /tmp/clashrelease 2>/dev/null | awk 'END{print NR}') ]; then
release_version=$(cat /tmp/clashrelease | awk '{print $1}' | sed -n "$num"p)
update_url="https://raw.githubusercontent.com/juewuy/ShellClash/$release_version"
saveserver

View File

@ -1,7 +1,7 @@
#!/bin/sh
#!/bin/sh
# Copyright (C) Juewuy
version=1.7.0b
version=1.7.0d
setdir(){
dir_avail(){

View File

@ -155,7 +155,7 @@ https://api.v1.mk
https://sub.xeton.dev
https://v.id9.cc
https://sub.maoxiongnet.com
http://sub2.shellclash.cf
http://sub2.jwsc.eu.org
EOF`
Config=`sed -n ""$rule_link"p"<<EOF
https://github.com/juewuy/ShellClash/raw/master/rules/ShellClash.ini
@ -180,7 +180,7 @@ EOF`
#如果传来的是Url链接则合成Https链接否则直接使用Https链接
if [ -z "$Https" -a -z "$retry" ];then
[ -n "$(echo $Url | grep -oE 'vless:')" ] && Server='https://api.v1.mk'
[ -n "$(echo $Url | grep -oE 'hysteria:')" ] && Server='https://sub.shellclash.cf'
[ -n "$(echo $Url | grep -oE 'hysteria:')" ] && Server='https://sub.jwsc.eu.org'
Https="$Server/sub?target=clash&insert=true&new_name=true&scv=true&udp=true&exclude=$exclude&include=$include&url=$Url&config=$Config"
url_type=true
fi
@ -1152,8 +1152,9 @@ bfstart(){
catpac
#预下载GeoSite数据库
if [ "$clashcore" = "clash.meta" ] && [ ! -f $bindir/GeoSite.dat ] && [ -n "$(cat $clashdir/config.yaml|grep -Ei 'geosite')" ];then
if [ -f $clashdir/*eo*ite.dat ];then
mv -f $clashdir/*eo*ite.dat $bindir/GeoSite.dat
[ -f $clashdir/geosite.dat ] && mv -f $clashdir/geosite.dat $clashdir/GeoSite.dat
if [ -f $clashdir/GeoSite.dat ];then
mv -f $clashdir/GeoSite.dat $bindir/GeoSite.dat
else
logger "未找到geosite数据库正在下载" 33
$0 webget $bindir/GeoSite.dat $update_url/bin/geosite.dat
@ -1359,7 +1360,7 @@ webget)
getconfig
[ -n "$authentication" ] && auth="$authentication@"
export https_proxy="http://${auth}127.0.0.1:$mix_port"
url=$(echo $3 | sed 's#https://.*/juewuy/ShellClash[@|/]#https://raw.githubusercontent.com/juewuy/ShellClash/#' | sed 's#https://gh.shellclash.cf/#https://raw.githubusercontent.com/juewuy/ShellClash/#')
url=$(echo $3 | sed 's#https://.*/juewuy/ShellClash[@|/]#https://raw.githubusercontent.com/juewuy/ShellClash/#' | sed 's#https://gh.jwsc.eu.org/#https://raw.githubusercontent.com/juewuy/ShellClash/#')
else
url=$(echo $3 | sed 's#https://.*/juewuy/ShellClash/#https://fastly.jsdelivr.net/gh/juewuy/ShellClash@#')
fi