centos-7-init-1.2.sh
This commit is contained in:
parent
a28ef310eb
commit
5f758da3f5
|
@ -4,7 +4,6 @@
|
|||
|
||||
read -p "是否安装宝塔?(y/n)" isBaota
|
||||
read -p "是否安装Docker?(y/n)" isDocker
|
||||
read -p "是否安装JDK8?(y/n)" isJDK8
|
||||
|
||||
|
||||
echo "更改YUM为阿里源"
|
||||
|
@ -62,9 +61,3 @@ if [ $isJDK8 = "y" ]; then
|
|||
java -version
|
||||
echo "JDK安装完成"
|
||||
fi
|
||||
|
||||
if [ $isBaota = "y" ]; then
|
||||
echo "安装宝塔"
|
||||
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
|
||||
echo "宝塔安装完成"
|
||||
fi
|
||||
|
|
70
CentOS/7/all/centos-7-init-1.2.sh
Normal file
70
CentOS/7/all/centos-7-init-1.2.sh
Normal file
|
@ -0,0 +1,70 @@
|
|||
#!/bin/bash
|
||||
|
||||
# curl -o init.sh https://git.zykeji.club/open/server-init/raw/master/CentOS/7/all/centos-7-init-1.1.sh && sh init.sh
|
||||
|
||||
read -p "是否安装宝塔?(y/n)" isBaota
|
||||
read -p "是否安装Docker?(y/n)" isDocker
|
||||
read -p "是否安装JDK8?(y/n)" isJDK8
|
||||
|
||||
|
||||
echo "更改YUM为阿里源"
|
||||
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
|
||||
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
|
||||
yum clean all
|
||||
yum makecache
|
||||
|
||||
echo "安装wget"
|
||||
yum install -y wget
|
||||
|
||||
echo "安装 net-tools"
|
||||
yum install -y net-tools
|
||||
|
||||
echo "安装 vim"
|
||||
yum install -y vim
|
||||
|
||||
echo "升级所有包同时也升级软件和系统内核"
|
||||
yum -y update
|
||||
|
||||
if [ $isDocker = "y" ]; then
|
||||
echo "安装Docker"
|
||||
echo "清除旧版本"
|
||||
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
|
||||
yum remove docker-ce
|
||||
echo "安装相关依赖"
|
||||
yum install -y yum-utils device-mapper-persistent-data lvm2
|
||||
echo "配置YUM源加速"
|
||||
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
|
||||
echo "安装Docker"
|
||||
yum install -y docker-ce docker-ce-cli containerd.io
|
||||
echo "启动并设置自启"
|
||||
systemctl start docker
|
||||
systemctl enable docker
|
||||
echo "设置Docker镜像加速"
|
||||
mkdir -p /etc/docker
|
||||
tee /etc/docker/daemon.json <<-'EOF'
|
||||
{
|
||||
"registry-mirrors": ["https://qu3lgucz.mirror.aliyuncs.com"]
|
||||
}
|
||||
EOF
|
||||
echo "刷新配置"
|
||||
systemctl daemon-reload
|
||||
systemctl restart docker
|
||||
echo "Docker安装完成"
|
||||
fi
|
||||
|
||||
if [ $isJDK8 = "y" ]; then
|
||||
echo "安装JDK8"
|
||||
echo "清除旧版本"
|
||||
rpm -qa | grep java | xargs rpm -e --nodeps
|
||||
echo "安装"
|
||||
yum install java-1.8.0-openjdk* -y
|
||||
echo "查看JDK版本信息"
|
||||
java -version
|
||||
echo "JDK安装完成"
|
||||
fi
|
||||
|
||||
if [ $isBaota = "y" ]; then
|
||||
echo "安装宝塔"
|
||||
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
|
||||
echo "宝塔安装完成"
|
||||
fi
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# curl -o init.sh https://git.zykeji.club/open/server-init/raw/master/CentOS/7/docker/docker-centos-7-install-1.0.sh && sh init.sh
|
||||
# curl -o docker-install.sh https://git.zykeji.club/open/server-init/raw/master/CentOS/7/docker/docker-centos-7-install-1.0.sh && sh docker-install.sh
|
||||
|
||||
echo "安装Docker"
|
||||
echo "清除旧版本"
|
||||
|
|
Loading…
Reference in New Issue
Block a user