lib/serverspec/backend/exec.rb in serverspec-0.2.7 vs lib/serverspec/backend/exec.rb in serverspec-0.2.8
- old
+ new
@@ -91,8 +91,20 @@
elsif by_whom == 'others'
mode_octal & 0001 != 0
end
end
+ def check_os
+ if do_check('ls /etc/redhat-release')[:exit_code] == 0
+ 'RedHat'
+ elsif do_check('ls /etc/debian_version')[:exit_code] == 0
+ 'Debian'
+ elsif do_check('ls /etc/gentoo-release')[:exit_code] == 0
+ 'Gentoo'
+ elsif do_check('uname -s')[:stdout] =~ /SunOS/i
+ 'Solaris'
+ end
+ end
+
end
end
end