文章分类 - shell脚本
摘要:chmod +x nginxmv nginx /etc/init.d/nginx
阅读全文
摘要:1 #!/bin/bash 2 while true 3 do 4 echo "1)放行端口 5 2)封锁端口 6 3)放行ip 7 4)封锁ip" 8 read -ep "请选择你的操作" num 9 case $num in 10 1) 11 while true 12 do 13 read -ep "请输入放行的端口" port 14 echo "正在...
阅读全文
摘要:1.安装expect yum -y install expect 2.创建iplist.txt文件(要分发的IP地址) 192.168.163.131 192.168.163.134 3.创建user.txt(里面包含密码) 3398986 3398986 4.创建脚本 test.sh,test.l
阅读全文
摘要:1 #!/bin/bash 2 CPU=`mpstat` 3 free=`free -m | grep Mem | awk '{print ($4/$2)*100}'` 4 network=`ping -c 1 www.baidu.com` 5 wj=`df -TH|grep sda|awk '{print $(NF -1)}'|awk -F% '{print $1}'` ...
阅读全文
摘要:#!/bin/bash user="sgd" ##用为mysql主从复制时授权的用户 password="123" ##授权用户是设立的密码 host='192.168.163.128' 主机地址 mycmd="mysql -u$user -p$password -h $host" chkdb(){ list=(`$mycmd -e"show slavestatus\G"|egrep"Run...
阅读全文
摘要:centos6版本的,我这个脚本名字 checkeveryday.sh 先将系统时间与网络时间同步 Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC)。 系统时间:指当前Linux Kernel中的时间。 硬件时间:主板上有电池供电的时
阅读全文