#!/bin/bash
#by lhy 2024-01-08
#init system
#关闭防火墙
systemctl stop firewalld && systemctl disable firewalld
echo “防火墙已关闭”
#关闭图形网络管理
systemctl disable NetworkManager && systemctl stop NetworkManager
echo “图形网络管理已关闭”
#关闭SElinux
sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/selinux/config
setenforce 0
#安装epel源
yum install -y epel-release
echo “epel源安装成功!”
#下载所需应用
#应用仅供自己所需安装
yum -y install vim vim-enhanced tcpdump lrzsz tree bash-completion net-tools wget bzip2 lsof tmux man-pages zip unzip nfs-utils gcc make gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel zlib-devel strace redhat-lsb-core rsync iptables-services chrony
#修改主机名
read -p "请输入主机名: " Newhostname
hostnamectl set-hostname $Newhostname
bash
#修改时区
timedatectl set-timezone Asia/Shanghai