you can see here to modify the init script:
or you can write a unsandboxed legato application to run a script when power on: