centos7脚本记录

heiu

配置网络连接

1
sed -i \'/BOOTPROTO/s/dhcp/static/g\' /etc/sysconfig/network-scripts/ifcfg-eno16777736sed -i \'/ONBOOT/s/no/yes/g\' /etc/sysconfig/network-scripts/ifcfg-eno16777736sed -i \'1a IPADDR=192.168.25.12\' /etc/sysconfig/network-scripts/ifcfg-eno16777736sed -i \'1a GATEWAY=192.168.25.1\' /etc/sysconfig/network-scripts/ifcfg-eno16777736sed -i \'1a NETMAKE=255.255.255.0\' /etc/sysconfig/network-scripts/ifcfg-eno16777736sed -i \'1a DNS=8.8.8.8\' /etc/sysconfig/network-scripts/ifcfg-eno16777736systemctl restart network

配置yum

1
mkdir /mnt/cdrommount /dev/cdrom /mnt/cdromsed -i 's/media/mnt/g' /etc/yum.repos.d/CentOS-Media.reposed -i '17,18d' /etc/yum.repos.d/CentOS-Media.reposed -i 's/CentOS/cdrom/g' /etc/yum.repos.d/CentOS-Media.reposed -i '/gpgcheck/s/1/0/g' /etc/yum.repos.d/CentOS-Media.reposed -i '/enabled/s/0/1/g' /etc/yum.repos.d/CentOS-Media.repocd /etc/yum.repos.d/rm -rf CentOS-Base.repo CentOS-fasttrack.repo CentOS-CR.repo CentOS-Vault.repo CentOS-Debuginfo.repo CentOS-Sources.repocd

配置其他

1
yum install -y gcc*sed -i '/SELINUX/s/enforcing/disabled/g' /etc/sysconfig/selinux

配置httpd

  • 标题: centos7脚本记录
  • 作者: heiu
  • 创建于 : 2021-03-30 09:06:00
  • 更新于 : 2024-05-30 22:34:00
  • 链接: https://blog.heiu.top/posts/6ab24fc5.html
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论