fixed dos line endings to unix; protected selinux calls for systems with no selinux