修改初始化脚本

master
Your Name 2 years ago
parent a755737717
commit 48ee8476ff
  1. 17
      os/get-os-init.sh

@ -62,7 +62,24 @@ remote_yum_make(){
} }
init(){ init(){
# 系统信息采集
color Info "当前用户 $USER"
color Info "当前时间 `date "+%F %X"`"
echo 3 >/proc/sys/vm/drop_caches
color Info "当前内存 $(free |awk 'NR==2{print $4/1024}')M"
color Info "当前核心 $(grep -E '^processor' /proc/cpuinfo|wc -l)"
color Info "核心品牌 $(grep -E '^model name' /proc/cpuinfo |head -n 1 |awk -F: '{print $2}')"
color Info "启动时长 $(uptime |awk -F',' '{print $1}')"
color Success "开始配置静态ip" color Success "开始配置静态ip"
color Info "修改文件打开数、进程打开数"
cat >>/etc/security/limits.conf <<EOF
* soft nofile 65535
* hard nofile 65535
* soft nproc 1024
* hard nproc 1024
EOF
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
sed -i 's/#UseDNS.*/UseDNS no/' /etc/ssh/sshd_config
static_addr static_addr
if [ $? -eq 10 ];then if [ $? -eq 10 ];then
color Success "静态ip配置并检测完成" color Success "静态ip配置并检测完成"

Loading…
Cancel
Save