How can I run a script on boot?
While looking around my Android filesystem, I found that it did, in fact have a
/etc/init.d/directory. After peeking around in there, I found
/etc/init.d/20userinitwith the following lines:
if [ -e /data/local/userinit.sh ]; then log -p -i -t userinit "Executing /data/local/userinit.sh"; busybux chmod +x /data/local/userinit.sh; logwrapper /system/bin/sh /data/local/userinit.sh; setprop cm.userinit.active 1; fi;
This being, of course, exactly what I needed, I wrote the following script on my computer then pushed it to my device:
#!/system/bin/sh dropbear -s -g
(pushed to device via
scp userinit.sh phone:/data/local/userinit.sh, mind you :] )
Rebooted the device, then ran
ps | grep "[d]ropbear", and sure enough, it's running. Coolness!