added connectivity check and process lock
output redirect on ping