check the exit status

Usually when you run a command you get an exit status of 0. So instead of checking the result of a command with a regex you can check the exit status.

`ping -q -c #{ping_count} #{server}`
if $?.exitstatus == 0
    # do something

守: Follow the rules.

破: Break the rules.

離: Make your own rules.