The Rules Exec module provides a Rules action that allows you to run shell commands from your own rules. The action will add variables with the command output as a list, plus the command return value, allowing you to do further checking and processing.
Please, read the documentation, specially the WARNING section. Running shell commands is risky business, specially if you plan to feed them user input.
Rules ctools allows embedding Rules components as content panes in Panels (and other modules using the CTools content panes). The parameters for the Rules components can either entered manually by end-users in a form, or set by CTools contexts.
Furthermore Rules ctools allows you to use any rules condition component as access check for content panes (panels, mini panels and other modules that using ctools panes.