@bu3304 So the problem is that script. Stopping the script before launching Kodi and then starting it again when you exit Kodi should work.