Try to find /var/log/sys log first to avoid the wrong OS detection.

Ubuntu system typicall has /var/log/messages. So the detection of
OS type may make mistake.
Remove an unnecessary variable: kindOfOS.