# File lib/smart_proxy_salt/salt_main.rb, line 8 def shell_command(cmd, wait = true) begin c = popen(cmd) unless wait Process.detach(c.pid) return 0 end Process.wait(c.pid) logger.info("Result: #{c.read}") rescue Exception => e logger.error("Exception '#{e}' when executing '#{cmd}'") return false end logger.warn("Non-null exit code when executing '#{cmd}'") if $?.exitstatus != 0 $?.exitstatus == 0 end