v1.0.0beta5

~更名为ShellClash,支持更多设备
~调整脚本更新链接
~修复debian等系统下使用dash运行时报错的bug
This commit is contained in:
juewuy
2020-09-13 19:33:39 +08:00
parent 5b90f49c4f
commit 7be54e1031
5 changed files with 30 additions and 22 deletions

View File

@@ -1,23 +1,22 @@
#!/bin/sh
#! /bin/bash
# Copyright (C) Juewuy
echo "***********************************************"
echo "** 欢迎使用 **"
echo "** Clash for Miwifi **"
echo "** ShellClash **"
echo "** by Juewuy **"
echo "***********************************************"
url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash@latest"
result=$(curl -w %{http_code} -skLo /tmp/clashversion $url/bin/version)
[ "$result" != "200" ] && echo "无法连接到服务器!" && exit 1
source /tmp/clashversion
echo -e "~~~~版本:\033[32m$versionsh\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[44m使用中如遇问题请加TG群反馈\033[42;30m t.me/clashfm \033[0m"
echo -e "\033[44m如遇问题请加TG群反馈\033[42;30m t.me/clashfm \033[0m"
echo -e "\033[37m支持各种基于openwrt的路由器设备"
echo -e "\033[33m有限支持debian、centos等Linux系统\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[32m 1 在默认目录(/etc)安装Clash for Miwifi"
echo -e "\033[32m 1 在默认目录(/etc)安装ShellClash"
echo -e "\033[33m 2 手动设置安装目录(不明勿用!)"
echo -e "\033[0m 0 退出安装"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -26,9 +25,9 @@ read -p "请输入相应数字 > " num
if [ -z $num ];then
echo 安装已取消
exit;
elif [[ $num == 1 ]];then
elif [ "$num" = "1" ];then
dir=/etc
elif [[ $num == 2 ]];then
elif [ "$num" = "2" ];then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo '可用路径 剩余空间:'
df -h | awk '{print $6,$2}'| sed 1d
@@ -71,15 +70,16 @@ fi
sed -i '/versionsh_l=*/'d $dir/clash/mark
sed -i "1i\versionsh_l=$versionsh" $dir/clash/mark
#设置环境变量
shtype=sh&&[ -n $(ls -l /bin/sh|grep -o dash) ]&&shtype=bash
sed -i '/alias clash=*/'d /etc/profile
echo "alias clash=\"sh $dir/clash/clash.sh\"" >> /etc/profile #设置快捷命令环境变量
echo "alias clash=\"$shtype $dir/clash/clash.sh\"" >> /etc/profile #设置快捷命令环境变量
sed -i '/export clashdir=*/'d /etc/profile
echo "export clashdir=\"$dir/clash\"" >> /etc/profile #设置clash路径环境变量
#删除临时文件
rm -rf /tmp/clashfm.tar.gz
#提示
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo clash for Miwifi 已经安装成功!
echo ShellClash 已经安装成功!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[33m输入\033[30;47m clash \033[0;33m命令即可管理\033[0m"
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~