摘要:
- hosts: webservers tasks: - name: '传输jdk包' copy: src=jdk-8u131-linux-x64_.rpm dest=/root/ - name: '安装jdk' yum: name=jdk-8u131-linux-x64_.rpm state=in 阅读全文
摘要:
安装ansible 配置主机 这里就不写了 1.编写playbook - hosts: webservers vars: - ROOT: /opt/html - PORT: 80 tasks: - name : '配置班级源' script: repo.sh - name : '安装httpd和la 阅读全文
摘要:
1.ssh交互 #!/bin/bash passwd='123' usradd="172.168.74.138" /usr/bin/expect <<EOF spawn ssh root@$usradd expect { "yes/no" { send "yes\r";exp_continue } 阅读全文
摘要:
1.自动检测mysql主从 有没有配置成功 #!/bin/bash check(){ list=($(mysql -e "show slave status\G;" 2>/dev/null |egrep "Running|Behind" |head -n3|awk -F ':' '{print $2 阅读全文
摘要:
猜数字 #! /bin/bash prive=$(($RANDOM%100+1)) echo $prive count=1 while true do read -p "请输入一个1--100的随机数:" num if [ $num -gt $prive ]; then echo "大了" elif 阅读全文