How to execute a shell script from init.rc after boot finished

Place something like this in your init.rc:
on property:dev.bootcomplete=1
    start bootcomplete_handler

service bootcomplete_handler /system/bin/sh /system/bin/
    class late_start
    user root
    group root


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

strangly recovered every time after boot

Made like described btw after device rebooted init.rc looks like it was before and its date is 1970-01-01 02:00. Is there a way to stop its recovering?

Re: strangly recovered every time after boot

Did you create the /system/bin/ (your own shell script that you want to launch on boot) file as well?
Here's a more comprehensive guide with lots of ideas:

Eg. if you find that init.rc is reset during boot, you might have to modify your boot image too.

Syndicate content