Osmc is using systemd. You should make a script (unit) for that.
There are several threads about this on the forum: