随笔分类 -  shell

摘要:话不多说,直接上脚本 #!/bin/bash read -ep "请输入检查的时间间隔:" timejg echo "检查时间间隔(单位秒):"$timejg while : do echo "CPU为占用为" ps -aux | grep httpd | grep 'apache' | awk ' 阅读全文
posted @ 2020-07-09 15:07 厶訫 阅读(19) 评论(0) 推荐(0)
摘要:#!/bin/bash while true do echo " 1,放行端口 2,封锁端口 3,放行IP 4,封锁IP" read -ep "请输入您要操作编号:" bh case $bh in 1) read -ep "请输入放行端口:" port echo "正在放行端口......" ipt 阅读全文
posted @ 2020-05-11 11:00 厶訫 阅读(53) 评论(0) 推荐(0)
摘要:# chkconfig: 2345 99 20<br>2345表示系统运行级别是2,3,4或者5时都启动此服务,<br>99,是启动的优先级,<br>20, 是关闭的优先级 #description: nginx-server #!/bin/bash nginx=/usr/local/nginx/s 阅读全文
posted @ 2020-04-24 19:43 厶訫 阅读(47) 评论(0) 推荐(0)
摘要:#!/bin/bash num=$[RANDOM%100+1] #随机获取1-100以内的数字 cishu=0 #初始变量用来计数 while true do echo "$num" read -ep "计算机生成了一个1-100的随机数,你猜: " nun #输入猜的数字 let cishu+=1 阅读全文
posted @ 2020-04-18 12:15 厶訫 阅读(39) 评论(0) 推荐(0)