~优化安装脚本及安装流程
~合并https://github.com/juewuy/ShellClash/pull/309
This commit is contained in:
juewuy 2023-01-23 17:17:30 +08:00
parent 4447244b61
commit 6794271c5e
6 changed files with 9 additions and 11 deletions

Binary file not shown.

Binary file not shown.

View File

@ -44,7 +44,7 @@ error_down(){
}
#安装及初始化
gettar(){
webget /tmp/clashfm.tar.gz $tarurl
webget /tmp/ShellClash.tar.gz $tarurl
if [ "$result" != "200" ];then
$echo "\033[33m文件下载失败\033[0m"
error_down
@ -55,9 +55,9 @@ gettar(){
echo -----------------------------------------------
echo 开始解压文件!
mkdir -p $clashdir > /dev/null
tar -zxvf '/tmp/clashfm.tar.gz' -C $clashdir/
tar -zxvf '/tmp/ShellClash.tar.gz' -C $clashdir/
if [ $? -ne 0 ];then
rm -rf /tmp/clashfm.tar.gz
rm -rf /tmp/ShellClash.tar.gz
$echo "\033[33m文件解压失败\033[0m"
error_down
exit 1
@ -235,7 +235,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/clashfm.tar.gz
tarurl=$url_dl/bin/ShellClash.tar.gz
#输出
$echo "最新版本:\033[32m$release_new\033[0m"

View File

@ -151,9 +151,8 @@ getlink(){
if [ -n "$Url_link" ];then
i=100
#将用户链接写入mark
sed -i '/Https=*/'d $ccfg
setconfig Https
setconfig Url \'$Url_link\'
Https=""
#获取在线yaml文件
getyaml
else

View File

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

View File

@ -1114,7 +1114,8 @@ bfstart(){
[ -z "$cpucore" ] && logger 找不到设备的CPU信息请手动指定处理器架构类型 31 && setcpucore
[ "$update_url" = "https://jwsc.eu.org:8888" ] && [ "$clashcore" != 'clash' ] && update_url=https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master
$0 webget $bindir/clash "$update_url/bin/$clashcore/clash-linux-$cpucore"
[ "$?" = "1" ] && rm -rf $bindir/clash && logger "核心下载失败,已退出!" 31 && exit 1
#校验内核
chmod +x $bindir/clash 2>/dev/null
clashv=$($bindir/clash -v 2>/dev/null | sed 's/ linux.*//;s/.* //')
if [ -z "$clashv" ];then
rm -rf $bindir/clash
@ -1420,9 +1421,7 @@ unset_proxy)
sed -i '/all_proxy/'d $profile
sed -i '/ALL_PROXY/'d $profile
;;
-t)
$2 $3 $4 $5 $6
;;
esac
exit 0