Darius-D

导航

随笔分类 -  Shell脚本

检测MySQL主从备份是否运行
摘要:通过查看 slave 状态,确保 Slave_IO_Running: Yes Slave_SQL_Running: Yes #!/bin/bash#Author:Darius-Dmysql -uroot -p123123 -e 'show slave status\G' >a.txtIO=`head 阅读全文

posted @ 2018-08-23 14:06 Darius-D 阅读(346) 评论(0) 推荐(0)

shell编写自动化安装dhcp服务
摘要:#!/bin/bash#Auth:Darius#自动化安装dhcp服务#"$1"为测试IP,用来查看IP段是否能通eno=`ifconfig|awk '{print $1}'|head -1|awk -F ":" '{print $1}'`file=/etc/sysconfig/network-sc 阅读全文

posted @ 2018-08-14 15:15 Darius-D 阅读(292) 评论(0) 推荐(0)

shell搭建CentOS_7基础环境
摘要:#!/bin/bash#Auth:Darius#CentOS_7配置实验环境eno=`ifconfig|awk '{print $1}'|head -1|awk -F ":" '{print $1}'`file=/etc/sysconfig/network-scripts/ifcfg-$enodir 阅读全文

posted @ 2018-08-14 14:26 Darius-D 阅读(200) 评论(0) 推荐(0)

Shell的特殊变量
摘要:在Shell里存在的一些特殊变量:$!、$@、$#、$$、$*、$0、$n、$_、$? [root@shell ~]# sh shell.sh aaa bbb ccc$0 获取当前执行的shell脚本的文件名:shell.sh$n 获取当前执行的shell脚本的第n个参数值,n=1..9:$1=aa 阅读全文

posted @ 2018-07-31 19:52 Darius-D 阅读(344) 评论(0) 推荐(0)