Fixed bug missing brace in if statement.
Added some functions to check it the vm is debian or redhat based and
get the proper package manager, apt or yum.