This module provides a new field type which allows custom pricing logic to be applied to the recurring charges generated by the Commerce License Billing module. This field type can be applied to license bundles or user accounts and handles various license-related conditions, possible pricing actions, and expiration handling all within the UI of the new field type.
This module is under active development at Platform.sh and is on its way to being ready for prime-time (although it is not there yet.)
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.