Check if the server is powered on

  
                  

The script is relatively simple and can be used to determine if the server is powered on.

#!/bin/bash #Checks to see if hosts 192.168.1.1-192.168.1.255 are alive for n in {1..200}; do host=192.168.1.$n ping -c2 $ Host &>/dev/null if [ $? = 0 ]; then echo "$host is UP" else echo "$host is DOWN" fi done

Copyright © Windows knowledge All Rights Reserved