diff --git a/bin/ShellClash.tar.gz b/bin/ShellClash.tar.gz deleted file mode 100644 index a8c3183..0000000 Binary files a/bin/ShellClash.tar.gz and /dev/null differ diff --git a/bin/ShellCrash.tar.gz b/bin/ShellCrash.tar.gz new file mode 100644 index 0000000..724264a Binary files /dev/null and b/bin/ShellCrash.tar.gz differ diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index 7ee2e1e..c24562c 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/public.tar.gz b/bin/public.tar.gz index 43b580a..e4030b7 100644 Binary files a/bin/public.tar.gz and b/bin/public.tar.gz differ diff --git a/bin/version b/bin/version index a545306..8830343 100644 --- a/bin/version +++ b/bin/version @@ -3,4 +3,4 @@ clashpre_v=2022.11.25 clash_v=v1.7.1 meta_v=v1.17.0 GeoIP_v=20231230 -versionsh=1.8.2e +versionsh=1.8.2f diff --git a/install.sh b/install.sh index 0da160f..b6712f7 100644 --- a/install.sh +++ b/install.sh @@ -9,7 +9,7 @@ echo='echo -e' } echo "***********************************************" echo "** 欢迎使用 **" -echo "** ShellClash **" +echo "** ShellCrash **" echo "** by Juewuy **" echo "***********************************************" #内置工具 @@ -17,7 +17,7 @@ dir_avail(){ df $2 $1 |awk '{ for(i=1;i<=NF;i++){ if(NR==1){ arr[i]=$i; }else{ arr[i]=arr[i]" "$i; } } } END{ for(i=1;i<=NF;i++){ print arr[i]; } }' |grep -E 'Ava|可用' |awk '{print $2}' } setconfig(){ - configpath=$clashdir/mark + configpath=$CRASHDIR/configs/ShellCrash.cfg [ -n "$(grep ${1} $configpath)" ] && sed -i "s#${1}=.*#${1}=${2}#g" $configpath || echo "${1}=${2}" >> $configpath } webget(){ @@ -42,27 +42,27 @@ webget(){ fi } error_down(){ - $echo "请参考 \033[32mhttps://github.com/juewuy/ShellClash/blob/master/README_CN.md" + $echo "请参考 \033[32mhttps://github.com/juewuy/ShellCrash/blob/master/README_CN.md" $echo "\033[33m使用其他安装源重新安装!\033[0m" } #安装及初始化 gettar(){ - webget /tmp/ShellClash.tar.gz $tarurl + webget /tmp/ShellCrash.tar.gz $tarurl if [ "$result" != "200" ];then $echo "\033[33m文件下载失败!\033[0m" error_down exit 1 else - $clashdir/start.sh stop 2>/dev/null + $CRASHDIR/start.sh stop 2>/dev/null #解压 echo ----------------------------------------------- echo 开始解压文件! - mkdir -p $clashdir > /dev/null - tar -zxf '/tmp/ShellClash.tar.gz' -C $clashdir/ || tar -zxf --no-same-owner '/tmp/ShellClash.tar.gz' -C $clashdir/ - if [ -f $clashdir/init.sh ];then - source $clashdir/init.sh >/dev/null + mkdir -p $CRASHDIR > /dev/null + tar -zxf '/tmp/ShellCrash.tar.gz' -C $CRASHDIR/ || tar -zxf '/tmp/ShellCrash.tar.gz' --no-same-owner -C $CRASHDIR/ + if [ -f $CRASHDIR/init.sh ];then + source $CRASHDIR/init.sh >/dev/null else - rm -rf /tmp/ShellClash.tar.gz + rm -rf /tmp/ShellCrash.tar.gz $echo "\033[33m文件解压失败!\033[0m" error_down exit 1 @@ -92,7 +92,7 @@ setdir(){ fi } echo ----------------------------------------------- -$echo "\033[33m注意:安装ShellClash至少需要预留约1MB的磁盘空间\033[0m" +$echo "\033[33m注意:安装ShellCrash至少需要预留约1MB的磁盘空间\033[0m" if [ -n "$systype" ];then [ "$systype" = "Padavan" ] && dir=/etc/storage [ "$systype" = "mi_snapshot" ] && { @@ -174,7 +174,7 @@ if [ ! -w $dir ];then else $echo "目标目录\033[32m$dir\033[0m空间剩余:$(dir_avail $dir -h)" read -p "确认安装?(1/0) > " res - [ "$res" = "1" ] && clashdir=$dir/clash || setdir + [ "$res" = "1" ] && CRASHDIR=$dir/clash || setdir fi } install(){ @@ -183,11 +183,11 @@ echo 开始从服务器获取安装文件! echo ----------------------------------------------- gettar echo ----------------------------------------------- -echo ShellClash 已经安装成功! +echo ShellCrash 已经安装成功! [ "$profile" = "~/.bashrc" ] && echo "请执行【source ~/.bashrc &> /dev/null】命令以加载环境变量!" [ -n "$(ls -l /bin/sh|grep -oE 'zsh')" ] && echo "请执行【source ~/.zshrc &> /dev/null】命令以加载环境变量!" echo ----------------------------------------------- -$echo "\033[33m输入\033[30;47m clash \033[0;33m命令即可管理!!!\033[0m" +$echo "\033[33m输入\033[30;47m crash \033[0;33m命令即可管理!!!\033[0m" echo ----------------------------------------------- } @@ -214,12 +214,12 @@ if [ "$USER" != "root" -a -z "$systype" ];then fi #检查更新 -url_cdn="https://fastly.jsdelivr.net/gh/juewuy/ShellClash" +url_cdn="https://fastly.jsdelivr.net/gh/juewuy/ShellCrash" [ -z "$url" ] && url=$url_cdn echo ----------------------------------------------- $echo "\033[33m请选择想要安装的版本:\033[0m" -$echo " 1 \033[32mShellclash公测版\033[0m" -$echo " 2 \033[36mShellclash稳定版\033[0m" +$echo " 1 \033[32mShellCrash公测版\033[0m" +$echo " 2 \033[36mShellCrash稳定版\033[0m" echo ----------------------------------------------- read -p "请输入相应数字 > " num if [ -z $num ];then @@ -239,7 +239,7 @@ webget /tmp/clashversion "$url_dl/bin/version" echooff [ -z "$release_new" ] && release_new=$versionsh rm -rf /tmp/clashversion rm -rf /tmp/clashrelease -tarurl=$url_dl/bin/ShellClash.tar.gz +tarurl=$url_dl/bin/ShellCrash.tar.gz #输出 $echo "最新版本:\033[32m$release_new\033[0m" @@ -248,15 +248,15 @@ $echo "\033[44m如遇问题请加TG群反馈:\033[42;30m t.me/ShellClash \033[ $echo "\033[37m支持各种基于openwrt的路由器设备" $echo "\033[33m支持Debian、Centos等标准Linux系统\033[0m" -if [ -n "$clashdir" ];then +if [ -n "$CRASHDIR" ];then echo ----------------------------------------------- - $echo "检测到旧的安装目录\033[36m$clashdir\033[0m,是否覆盖安装?" + $echo "检测到旧的安装目录\033[36m$CRASHDIR\033[0m,是否覆盖安装?" $echo "\033[32m覆盖安装时不会移除配置文件!\033[0m" read -p "覆盖安装/卸载旧版本?(1/0) > " res if [ "$res" = "1" ];then install elif [ "$res" = "0" ];then - rm -rf $clashdir + rm -rf $CRASHDIR echo ----------------------------------------------- $echo "\033[31m 旧版本文件已卸载!\033[0m" setdir diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 3a88779..5d4b9af 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -1213,7 +1213,9 @@ setserver(){ echo -e " 0 返回上级菜单" read -p "请输入对应数字 > " num case $num in - [0-99]) + 0) + ;; + [1-99]) release_type=$(grep -aE '^1|^2' $CRASHDIR/configs/servers.list | sed -n ""$num"p" | awk '{print $4}') if [ "release_type" = "稳定版" ];then release_url=$(grep -aE '^1' $CRASHDIR/configs/servers.list | sed -n ""$num"p" | awk '{print $3}') diff --git a/scripts/init.sh b/scripts/init.sh index d8419c4..d6e6165 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -1,7 +1,7 @@ #!/bin/sh # Copyright (C) Juewuy -version=1.8.2e +version=1.8.2f setdir(){ dir_avail(){ @@ -195,7 +195,7 @@ if [ -n "$profile" ];then source $profile &>/dev/null || echo 运行错误!请使用bash而不是dash运行安装命令!!! #适配zsh环境变量 [ -n "$(ls -l /bin/sh|grep -oE 'zsh')" ] && [ -z "$(cat ~/.zshrc 2>/dev/null|grep CRASHDIR)" ] && { - echo "alias clash=\"$shtype $CRASHDIR/clash.sh\"" >> ~/.zshrc + echo "alias crash=\"$shtype $CRASHDIR/clash.sh\"" >> ~/.zshrc echo "export CRASHDIR=\"$CRASHDIR\"" >> ~/.zshrc source ~/.zshrc &>/dev/null }