
Scripts
石兴稳
车轮塑造形体,技术改变生活
展开
-
sed -i.bak 备份加替换
sed -i.bak 备份加替换 sed -i.bak "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config原创 2018-03-29 18:17:32 · 5836 阅读 · 0 评论 -
获取本机ip
ip a show dev eth0 scope global |grep "inet" |sed -e 's#.*inet##g' -e 's#/.*##g'原创 2018-04-21 09:18:45 · 196 阅读 · 0 评论 -
shell expect 实现同步ssh no passwd access
shell expect 实现同步ssh no passwd accessfor i in `echo $nocde_lists |awk '{print $2,$3}'`doexpect < EOF set timeout 2 spawn ssh-copy-id root@$i expect { "yes/no" {send "y...原创 2019-01-08 17:58:46 · 205 阅读 · 0 评论 -
shell while true if
记一次路由无缘丢失的检查脚本,如果丢失曾立即添加,#!/bin/bash#readme#检查路由是否存在,如果存在则继续,否则增加一条路由##后台执行语句: nohup /bin/bash /home/check_route.sh &while truedo count_num=`route -n |grep 192.xxx.xxx.xxx |wc -l`...原创 2019-04-01 11:41:03 · 12632 阅读 · 0 评论 -
zabbix_agent.sh
#!/bin/bashif [ "`grep '192.168.10.2 zabbixproxy.xxxx.com' /etc/hosts`" = "" ];thenecho "192.168.10.2 zabbixproxy.xxxx.com" >> /etc/hostsfi#IP=`ip a show dev eth0 scope global |grep "inet"...原创 2019-03-13 14:42:30 · 267 阅读 · 0 评论