#!/bin/bash
#假设本机为 192.168.4.100,编写脚本关闭除自己外的其他所有主机
#脚本执行,需要提前给所有其他主机传递 ssh 密钥,满足无密码连接

for i in {1..254}
do
     [ $i -eq 100 ] && continue
     echo "正在关闭 192.168.4.$i..."
     ssh 192.168.4.$i poweroff
done

相关文章:

  • 2021-07-17
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
猜你喜欢
  • 2021-11-08
  • 2021-10-21
  • 2021-09-25
  • 2022-12-23
  • 2021-12-12
  • 2021-12-27
  • 2022-01-05
相关资源
相似解决方案