Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux initialization script 1.1

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Version:1.1

Des: initialization configuration for redhat operating system virtual machines

Update the following:

Add network detection add network card name judge add host variable configuration thin yum and .bashrc configuration file generation, reference variables directly in the configuration file through 'EOF' Remove the variable $before\ repair yum configuration mobile command error cannot move bak directory itself repair unconfigured gateway error #! / bin/bash#===# Author: Mr.Song# Create Date: 2019-10-27 # Description:#===### # set-x echo 'nameserver 119.29.29.29' > > / etc/resolv.conf ping-c 2 www.baidu.com 2 > & 1 > / dev/null | |' echo-e'\ 033 [31mNetwork test fail Please check network configuration\ 033 [0m'& & exit 1'# start intial script#### # NET_INETERFACE_NAME= `ip a | grep-v lo | egrep ^ [0-9] | cut-f 2-d':'| sed's # [[: space:]] # '`HOST_IP='192.168.10.11'HOST_NETMASK='24'HOST_GATEWAY='192.168.10.2'HOST_DNS='119.29.29.29'HOST_NAME='test'## # # hostnamectl set-hostname $HOST_NAME###disable firewalld and selinuxsystemctl stop firewalldsystemctl disable firewalldsetenforce 0sed-I's pick up for each other in order to change the cost of ledplash g'/ Etc/selinux/config#yum configmkdir -p / etc/yum.repos.d/bakmv / etc/yum.repos.d/*.repo / etc/yum.repos.d/bak/cat > / etc/yum.repos.d/CentOS-163.repo ~ / .bashrc ~ / .vimrc

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report