Script when kodi shutdown

Hi there,

I have a bash script I would like to run as soon as Kodi is shutdown. Is there any way to manage that ?

I’m running a device without keyboard so basically the script is just a bash that start and allow to use button connected to the GPIO to launch program.

Thanks guys