Skip to content

Commit

Permalink
feat(脚本): 添加ip
Browse files Browse the repository at this point in the history
  • Loading branch information
mack-a committed Aug 11, 2020
1 parent 8dd2d85 commit 8659960
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 17 deletions.
19 changes: 11 additions & 8 deletions find_best_cdn_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Loading

0 comments on commit 8659960

Please sign in to comment.