Closed loop script _ all hosts on the LAN

bin # / bash!
# Author: liusingbon
# function: Suppose the machine is 192.168.4.100, write a script to close all other hosts besides his own (before script execution, advance to all other hosts passed ssh key, no password to connect meet ).
for in {1..254} I
do
  [I -eq $ 100] && Continue
  echo "is closing 192.168.4. $ I ..."
  SSH 192.168.4. $ I
  the poweroff
DONE

 

Guess you like

Origin www.cnblogs.com/liusingbon/p/11122813.html