Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
# raidctrl.rb raidctrl_name = "none" # linux software raid check_linuxmd = ((%x{cat /proc/mdstat 2>/dev/null}.to_s =~ /^md.*: .*raid/m) != nil) if check_linuxmd then raidctrl_name = "linuxmd" end # hp smartarray / cciss check_cciss = %x{/usr/bin/lspci -d '103c:' 2>/dev/null}.to_s if check_cciss.include?("Smart Array") or check_cciss.include?("3238") then raidctrl_name = "cciss" end # areca raid check_areca = %x{/usr/bin/lspci -d '17d3:' 2>/dev/null}.to_s if check_areca.include?("RAID") then raidctrl_name = "areca" end Facter.add("raidctrl") do setcode do result = raidctrl_name end end
This paste will be private.
From the Design Piracy series on my blog: