feat(脚本): 添加ip

pull/534/merge
mack-a 2020-08-11 17:41:09 +08:00
parent 2757737499
commit c80ef612d7
2 changed files with 55 additions and 17 deletions

View File

@ -108,16 +108,12 @@ init(){
pingTool
}
checkSystem(){
if [[ ! -z `find /etc -name "redhat-release"` ]] || [[ ! -z `cat /proc/version | grep -i "centos" | grep -v grep ` ]] || [[ ! -z `cat /proc/version | grep -i "red hat" | grep -v grep ` ]] || [[ ! -z `cat /proc/version | grep -i "redhat" | grep -v grep ` ]]
if [[ "`uname`" = "Darwin" ]]
then
centosVersion=`rpm -q centos-release|awk -F "[-]" '{print $3}'`
release="centos"
installType='yum -y install'
removeType='yum -y remove'
upgrade="yum update -y --skip-broken"
elif [[ "`uname`" = "Darwin" ]]
release="Darwin"
elif [[ ! -z `find /etc -name "redhat-release"` ]] || [[ ! -z `cat /proc/version | grep -i "centos" | grep -v grep ` ]] || [[ ! -z `cat /proc/version | grep -i "red hat" | grep -v grep ` ]] || [[ ! -z `cat /proc/version | grep -i "redhat" | grep -v grep ` ]]
then
release="Darwin"
release="centos"
elif [[ ! -z `cat /etc/issue | grep -i "ubuntu" | grep -v grep` ]] || [[ ! -z `cat /proc/version | grep -i "ubuntu" | grep -v grep` ]]
then
release="ubuntu"
@ -134,5 +130,12 @@ checkSystem(){
exit 0;
fi
}
downloadIPs(){
echoContent yellow '开始下载ip文件'
wget -q -P /tmp/ https://raw.githubusercontent.com/mack-a/v2ray-agent/dev/fodder/ips/ips
echoContent yellow '下载结束'
}
downloadIPs
checkSystem
init

File diff suppressed because one or more lines are too long