那些年不上运维自动化 NO ZUO NO DIE 写下的关机脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了那些年不上运维自动化 NO ZUO NO DIE 写下的关机脚本相关的知识,希望对你有一定的参考价值。
#!/bin/sh
#author:jerry
#create date 2015-12
#last update: 2018-8-27
decide() {
[ $1 == 0 ] && echo "$2 $3 shutdown success" >>down.log || echo "$2 $3 shutdown fail" >>down.log
}
alias gom=‘ssh -p 1211 cwdb_m‘
alias gos=‘ssh -p 1211 cwdb_s‘
date=ssh js /bin/date
ip=ssh js hostname -i
down.log
ssh js /sbin/poweroff >/dev/null 2>&1
state=echo $?
decide $state $ip $date
date=ssh cwgzxt -p1211 /bin/date
ip=ssh cwgzxt -p1211 hostname -i
ssh cwgzxt -p1211 /sbin/poweroff >/dev/null 2>&1
state=echo $?
decide $state $ip $date
date=gom /bin/date
ip=gom hostname -i
gom /sbin/poweroff >/dev/null 2>&1
state=echo $?
decide $state $ip $date
date=gos /bin/date
ip=gos hostname -i
gos /sbin/poweroff >/dev/null 2>&1
state=echo $?
decide $state $ip $date
date=ssh [email protected] date
ip=192.168.17.190
ssh [email protected] /bin/gj.sh >/dev/null 2>&1
state=echo $?
decide $state $ip $date
date=ssh [email protected] date
ip=192.168.17.195
ssh [email protected] /bin/gj.sh >/dev/null 2>&1
state=echo $?
decide $state $ip $date
以上是关于那些年不上运维自动化 NO ZUO NO DIE 写下的关机脚本的主要内容,如果未能解决你的问题,请参考以下文章
python无法倒入pygal,报错ImportError: No module named pygal怎么解决
聚美优品胡俊:自动化运维平台的建设经验 | UPYUN Open Talk No.25
没有连接的AMQP / RabbitMQ通道何时死亡?(when does an AMQP/RabbitMQ channel with no connections die?)