Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
#!/bin/bash
target="google.com8.8.8.8"
count=$( ping -c 1 $target | grep icmp* | wc -l )
if [ $count -eq 0 ]
then
	date >> /home/user/pingfail.txt
	/sbin/shutdown -r now
else
	date >> /home/user/pingsuccess.txt
fi

...