• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






huazai007

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

文章分类 -  shell

 
一键安装dns主从服务器
摘要:一键安装dns主从服务器 #!/bin/bash firwalld_stop(){ systemctl stop firewalld setenforce 0 } yum_install(){ yum install bind bind-chroot bind-utils -y } sed_chan 阅读全文
posted @ 2019-12-30 17:08 huazai007 阅读(126) 评论(0) 推荐(0)
grep sed awk
摘要:grep grep 是linux 中最常用的“文本处理工具之一” 与sed awk 合称为linux中的三剑客! grep 就像你在windows中打开txt文件,使用快捷键“Ctrl+F” 在文本中查找某个字符串一样,可以把grep 理解为字符查找工具 grep 的全程为Global search 阅读全文
posted @ 2019-12-02 13:19 huazai007 阅读(400) 评论(0) 推荐(0)
使用expect ftp 免交互上传文件
摘要:防火墙关掉! 1 安装expect命令 yum -y install expect 2 vim ftp_upload.sh #!/usr/bin/expect spawn ftp localhost #执行ftp命令 expect "Name*" #如果出现Name字符 send "ftp\n" # 阅读全文
posted @ 2019-11-19 18:41 huazai007 阅读(545) 评论(0) 推荐(0)
shell 一键部署 zabbix 4.0
摘要:shell 一键部署 zabbix 4.0 #!/bin/bash #关闭防火墙,关闭selinux systemctl stop firewalld setenforce 0 #配置yum源 rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86 阅读全文
posted @ 2019-11-18 14:12 huazai007 阅读(253) 评论(0) 推荐(1)
shell 检测keepalived+nginx
摘要:shell 检测keepalived+nginx #!/bin/bash check(){ for server in nginx keepalived do pidof $server if [ $? -eq 0 ]; then echo "$server is ok" else echo "$s 阅读全文
posted @ 2019-11-06 11:42 huazai007 阅读(200) 评论(0) 推荐(0)
shell 入侵检测与邮件告警
摘要:shell 入侵检测与邮件告警 #!/bin/bash webdir=/var/www/html cd $webdir#方法1 MD5sum校验 #md5sum /var/www/html/index.html >/opt/webfile.db md5sum -c --quiet /opt/webf 阅读全文
posted @ 2019-11-05 18:36 huazai007 阅读(282) 评论(0) 推荐(0)
shell 防ddos
摘要:shell 防ddos 案例1 通过封禁ip来解决ddos 获取连接数最多的前10个ip并临时写入文件dropip中 通过for循环来遍历dropip文件的ip 排除192.168开头和127.0开头的ip 然后遍历及排除完3题的ip后调用防火墙drop掉 并写日历文件到/var/log/ddos中 阅读全文
posted @ 2019-11-05 14:12 huazai007 阅读(180) 评论(0) 推荐(0)
shell 日常巡检
摘要:shell 日常巡检 #!/bin/bash ###系统信息######### os_system(){ os_type=$(uname) echo "操作系统的类型: ${os_type}" os_ver=$(cat /etc/redhat-release) echo "操作系统的版本号:${os 阅读全文
posted @ 2019-11-04 16:17 huazai007 阅读(238) 评论(0) 推荐(0)
shell 检测mysql 主从状态
摘要:在从上执行: [root@master ~]# cat check_master_slave_status.sh #!/bin/bash check(){ list=($(mysql -uroot -p123456 -S /tmp/mysql.sock2 -e "show slave status\ 阅读全文
posted @ 2019-11-04 14:43 huazai007 阅读(387) 评论(0) 推荐(0)
shell expect 免交互操作
摘要:shell expect expect的核心是spawn、expect、send、set。 spawn调用要执行的命令 expect监听交互输出 send进行交互输入 set设置变量值 interact交互完后,将控制权交给控制台 expect eof,与spawn对应,表示捕捉终端输出信息终止,类 阅读全文
posted @ 2019-11-04 12:18 huazai007 阅读(225) 评论(0) 推荐(0)
shell 分库分表备份
摘要:shell 分库分表备份 阅读全文
posted @ 2019-11-04 11:41 huazai007 阅读(160) 评论(0) 推荐(0)
shell mysql 建库建表
摘要:shell mysql 建库建表 阅读全文
posted @ 2019-11-04 11:39 huazai007 阅读(276) 评论(0) 推荐(0)
shell log切割
摘要:apache log切割脚本 阅读全文
posted @ 2019-11-02 11:57 huazai007 阅读(157) 评论(0) 推荐(0)
shell 检测服务及邮件报警
摘要:举个例子:查看端口是否存在 阅读全文
posted @ 2019-11-02 11:01 huazai007 阅读(257) 评论(0) 推荐(0)
shell 猜数字大小
摘要: 阅读全文
posted @ 2019-11-02 10:51 huazai007 阅读(164) 评论(0) 推荐(1)
shell 脚本检测网站存活
摘要:#!/bin/bash . /etc/init.d/functions check_fun(){ url_list=(www.baidu.com www.youku.com www.tudou.com www.xxxxxx55555555555555555555555xxxxxxxxxx.com) 阅读全文
posted @ 2019-11-02 10:50 huazai007 阅读(282) 评论(0) 推荐(0)
shell 复习
摘要:#! 是一个约定的标记,它告诉系统这个脚本需要什么解释器来执行,即使用哪一种 Shell shell 变量: name=”hauzai007” echo $name 注意事项: 变量名和等号之间不能有空格 不能使用标点符号 不能使用bash里的关键字 只读变量: name=”huazai007” 关 阅读全文
posted @ 2019-11-02 10:20 huazai007 阅读(295) 评论(0) 推荐(1)