I can provide something useful, hopefully:
Code taken (and, modified) from:
ping multiple IP's using bash?
#!/bin/bash
# Program name: pingall.sh
date
#/cat /path/tolist.txt | while read output
cat list.txt | while read output
do
ping -c 1 "$output" > /dev/null
if [ $? -eq 0 ]; then
# a try to assign ip adress:
sudo ifconfig eth0 192.168.0.1 netmask 255.255.255.0
echo "node $output is up"
else
echo "node $output is down"
fi
done
a try to assign ip adress:
sudo ifconfig eth0 192.168.0.1 netmask 255.255.255.0
Edit: The ifconfig (...) line is meant to be replaced by the found offline ip of choice.
The bold text Is the thing I modified, and while this will probably not work out of the box; It can hopefully provide some insight about how you would do; Since I am not a expert in bash, I am just hoping this will be useful. (Better than nothing I guess?)
If this is or if anyone finds anything that is , crazy. Totally wrong. Or downright wrong. Please, point that out