Close Kodi cleanly and start a shellscript?

Hi guys,

Possibly the wrong forum.

After the nightmare of trying to get Netflix to work right with Kodi when using ALSA I decided to write a couple of shellscripts:

On Ubuntu login: Kill PulseAudio and Launch Kodi (kodi.sh)

A desktop shortcut to: start PulseAudio and launch Chrome in Kiosk mode at netflix.com (netflix.sh)

I was wondering how plausible it is to write something that Gracefully closes Kodi and launches a shellscript?

I’m a complete Python amateur and amateur to addon development so I’m not sure if this is even doable

Cheers

Paddy