Bradme: first stub of 'exec cmd on state change'.