Please use the script check whether the specific application is installed and running? If the application is running then the execution logs show you the list of all services associated with it.
Note:
Please run the script as System User
Change the variable - AppName='your application name to be checked'
AppName = 'sophos'