CentOS 初始化脚本
#!/bin/bash # curl https://yiyingcanfeng.github.io/centos-init.sh | bash # 可选参数base kernel python php nodejs cmd_game jdk mysql mongodb docker # 比如 # curl https://yiyingcanfeng.github.io/centos-init.sh | bash -s base function system_config() { # 修改主机名 #hostnamectl set-hostname aaa # 禁用selinux sed -i 's/SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config setenforce 0 # 修改开机引导等待时间 sed -i 's/GRUB_TIMEOUT=.*/GRUB_TIMEOUT=2/g' /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg # 请根据具体情况来决定是否关闭防火墙 systemctl stop firewalld systemctl disable firewalld } function config_mirror_and_update() {