主页

索引

模块索引

搜索页面

创建ssh远程登录欢迎词

 1#!/bin/bash
 2
 3###########################
 4# 创建ssh远程登录欢迎词
 5###########################
 6
 7
 8# =======================
 9# CPU相关
10# =======================
11# cpu个数
12nu1=`cat /proc/cpuinfo |grep processor|sed '$!d'|awk '{print $3}'`
13let "nu=($nu1+1)"
14# cpu名称
15cupname=`cat /proc/cpuinfo |grep "model name"|sed '$!d'|awk '{print $4 " " $5 " " $7}'`
16# 修改欢迎界面
17echo cat   /proc/cpuinfo $cupname x$nu >> /etc/motd
18
19# 修改对应nginx配置文件
20let "nginxprocesses=($nu*2)"
21    sed -i "s@worker_processes 4@worker_processes [url=mailtonginxprocesses@g]$nginxprocesses@g[/url]" /data/conf/nginx/nginx.conf
22
23# =======================
24# memory相关
25# =======================
26
27Free=`free -m |grep Mem |awk '{print $2}'`
28echo cat /proc/meminfo   MemTotalFree MB >> /etc/motd
29
30# =======================
31# 磁盘信息
32# =======================
33fdisk -l|grep "Disk"|awk '{print $1 " " $2 " " $3 " " $4}'|sed 's/,/ /g' >> /etc/motd
34echo 'df -lhT' >> /root/.bash_profile
35    

主页

索引

模块索引

搜索页面