Hey, I'm trying to get comfortable making scripts. Can anyone help give me perfect my script below? Want to make a script that checks if a host is up and if the host isn't up it will make sure openvpn is up and running and try to ping again. If the host is up then it will say success prompt for further directions
read "What is your IP?: IP"
ping -c4 $ip
if the output contains "64 bytes from 10.10.10.x: icmp_seq=1 ttl=* time=* ms"
if not echo "Host is not up"
I know this is bad but can someone help perfect PLEASE?