Turn on Kodi with plug HDMI wire

Dear all,

I have a Raspberry B+.

I would like know if is possible turn on (execute) kodi when I connect the HDMI wire.

I tried make a script to change the “ENABLE” paramet in /etc/defualt/kodi when the raspberry is boot but I have not got it.

Using tvservice -M, I can know when the wire is connect/disconnect to Raspberry but i cant execute kodi with this.

Some idea?

Thanks in advance.

Regards