#!/bin/bash
for ip in {1..254}
doping -c 2 -i 0.3 -w 1 10.131.147.$ip &>/dev/nullif [ $? -eq 0 ]thenecho "10.131.147.$ip" >>connected.txtelseecho "10.131.147.$ip" >>disconnected.txtfi
done
#!/bin/bash
for ip in {1..254}
doping -c 2 -i 0.3 -w 1 10.131.147.$ip &>/dev/nullif [ $? -eq 0 ]thenecho "10.131.147.$ip" >>connected.txtelseecho "10.131.147.$ip" >>disconnected.txtfi
done