ll it seems my script works like should when I on my local network. Where I run into problems is when I am on my vpn. If I run the script while connected to the VPN it cannot ping the host. If I place the script on a server within the network it works fine. So now I need to find out why it is not pinging over the VPN because I do most of my work over it.
<Disregard my ramblings above>
I found the issue to the above problem, my "dev" box is a VM, VMware is preforming NAT to the VMs on my laptop. Then on top of that OpenVPN is performing NAT again which seems to be causing problems. If I connect OpenVPN directly to the VM the ping test using my script works like it should.