Wait to start Kodi until it has MySQL alive signal

There’s a feature built into Kodi since R13 - take a look here: http://kodi.wiki/view/Wake_on_lan
In short, Kodi can be configured to check for a working connection to an SMB- or a remote SQL-server prior to start and load data.