added login failure check. Improved file existance check. Fixed status check for centos