脚本_循环关闭局域网中所有主机

#!bin/bash
#作者:liusingbon
#功能:假设本机为 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

猜你喜欢

转载自www.cnblogs.com/liusingbon/p/11122813.html
今日推荐