Switch ==1 to !=0 - ping can exit with different errors (timeout, resolve failed etc), but we don't care what was the reason.