moving ping testing and logging out of individual scripts to clean it up