How the simplified version of Linux server initializes the Shell script
This article introduces the knowledge of "how to initialize the Shell script on the simple version of Linux server". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The Shell script is mainly used to initialize the newly installed Linux server system, including:
Close the IPv6 module
Close SELinux
Let vim display colors
Set system language coding
Optimize system servic
Kernel parameter optimization and so on.
Can be modified according to their own actual situation, can be used in the production environment. The original author is NetSeek, and I have made some modifications.
The code is as follows:
#! / bin/sh
# desc: lsm03624 modified by www.webnginx.com
#-cut begin
# welcome
Cat / etc/modprobe.conf
Echo "alias ipv6 off" > > / etc/modprobe.conf
/ sbin/chkconfig-- level 35 ip6tables off
Echo "ipv6 is disabled!"
# disable selinux
Sed-I'/ SELINUX/s/enforcing/disabled/' / etc/selinux/config
Echo "selinux is disabled,you must reboot!"
# vim
Sed-I "8 s / ^ / alias vi='vim'/" / root/.bashrc
Echo 'syntax on' > / root/.vimrc
# zh_cn
Sed-I-e's / ^ Lang =. * / LANG= "zh_CN.UTF-8" /'/ etc/sysconfig/i18n
# configure file max to 52100
Echo "* soft nofile 52100
* hard nofile 52100 "> > / etc/security/limits.conf
# tunoff services
#-
Cat > / etc/sysctl.conf
Echo "optimizited kernel configure was done!"
This is the end of the content of "how to initialize the Shell script for the simple version of Linux Server". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!