Automated firmware check through cli/script

Is there a way to check firmware status through a script, eg maybe hitting a /status url on the web admin? I’m trying to automate checking the firmware version on the router, and the current released version so I know if I have to initiate an update. And yes, I’m trying to do this without opening up InControl.

You can use SNMP, IC2 API or device API