1 Star 0 Fork 0

李皓天/钰深plus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
kvm.mysplus.sh 3.01 KB
一键复制 编辑 原始数据 按行查看 历史
李皓天 提交于 2021-12-25 05:06 . 钰深6代脚本
#!/bin/bash
echo -e -n "\e[34;40m███╗ ███╗██╗ ██╗███████╗\e[0m";
echo -e -n "\e[32;40m \e[0m";
echo -e "\e[31;40m██████╗ ██╗ ██╗ ██╗███████╗\e[0m";
echo -e -n "\e[34;40m████╗ ████║╚██╗ ██╔╝██╔════╝\e[0m";
echo -e -n "\e[32;40m \e[0m";
echo -e "\e[31;40m██╔══██╗██║ ██║ ██║██╔════╝\e[0m";
echo -e -n "\e[34;40m██╔████╔██║ ╚████╔╝ ███████╗\e[0m";
echo -e -n "\e[32;40m█████╗\e[0m";
echo -e "\e[31;40m██████╔╝██║ ██║ ██║███████╗\e[0m";
echo -e -n "\e[34;40m██║╚██╔╝██║ ╚██╔╝ ╚════██║\e[0m";
echo -e -n "\e[32;40m╚════╝\e[0m";
echo -e "\e[31;40m██╔═══╝ ██║ ██║ ██║╚════██║\e[0m";
echo -e -n "\e[34;40m██║ ╚═╝ ██║ ██║ ███████║\e[0m";
echo -e -n "\e[32;40m \e[0m";
echo -e "\e[31;40m██║ ███████╗╚██████╔╝███████║\e[0m";
echo -e -n "\e[34;40m╚═╝ ╚═╝ ╚═╝ ╚══════╝\e[0m";
echo -e -n "\e[32;40m \e[0m";
echo -e "\e[31;40m╚═╝ ╚══════╝ ╚═════╝ ╚══════╝\e[0m";
i=0
str=""
arr=("|" "/" "-" "\\")
while [ $i -le 20 ]
do
let index=i%4
let indexcolor=i%8
let color=30+indexcolor
let NUmbER=$i*5
printf "\e[0;$color;1m[%-40s][%d%%]%c钰深plus脚本加载中\r" "$str" "$NUmbER" "${arr[$index]}"
sleep 0.1
let i++
str+='++'
done
printf "\n"
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
systemctl stop firewalld.service
systemctl disable firewalld.service
iptables -F
iptables -X
iptables -Z
service iptables save
echo -e -n "\e[31;40m 必须要先设置主机名且必须相同(y/n): \e[0m"
read pan
sed -i '$a192.168.200.11 mysql1' /etc/hosts
sed -i '$a192.168.200.12 mysql2' /etc/hosts
sed -i '$a192.168.200.13 mycat' /etc/hosts
cd /etc/yum.repos.d/
rm -rvf *
cat >>centos.repo<<OK
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enable=1
[gpmall]
name=gpmall
baseurl=file:///opt/gpmall-repo
gpgcheck=0
enable=1
OK
cd
mount -o loop CentOS-7-x86_64-DVD-1511.iso /mnt/
mkdir /opt/centos
cp -rvf /mnt/* /opt/centos
umount /mnt/
cp -rvf /root/gpmall-repo /opt/
yum clean all
yum install -y qemu-kvm openssl libvirt
systemctl restart libvirtd
ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm
yum install net-tools -y
yum install vsftpd -y
systemctl restart vsftpd
systemctl enable vsftpd
sed -i '$ianon_root=/opt/' /etc/vsftpd/vsftpd.conf
mv qemu-ifup-NAT qemu-ifup-NAT.sh
chmod +x qemu-ifup-NAT.sh
qemu-kvm -m 1024 -drive file=/root/cirros-0.3.4-x86_64-disk.img,if=virtio -net nic,model=virtio -net tap,script=qemu-ifup-NAT.sh -nographic
ip addr list
route -n
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/mashiro2/mys-plus.git
git@gitee.com:mashiro2/mys-plus.git
mashiro2
mys-plus
钰深plus
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385