Motorola Droid Full Solution Updated

Testing now. Will edit soon.

EDIT: Works great. Tested 3 times after 3 different reboots.

So how does this sound:

#!/system/bin/sh
/system/bin/iptables -P INPUT ACCEPT
/system/bin/iptables -P OUTPUT ACCEPT
/system/bin/iptables -P FORWARD ACCEPT
/system/bin/iptables -F
/system/bin/iptables -t nat -F
/system/bin/iptables -X
/system/bin/iptables -t nat -A OUTPUT -o ppp0 -p 6 ! -d 10.133.26.12 -j REDIRECT --to-port 1025
exec /system/bin/u2nl 10.133.26.12 8080 1025
sleep 15
kill `ps|grep nk.bla.android.autostart|awk '{print $2}'`
 
Are you sure it is even killing anything? Nothing should happen after the exec line. Exec is a weird way of ending a script. Normally bash will fork and then execute the command, but when you use exec in a script, it skips the fork and just executes the command, with the command pretty much replacing bash. It should even retain the same PID. I find it hard to believe anything after the exec line happened unless the busybox bash or whatever you are using isn't working right.

I put a modified autostart.sh up on my site if you want to try that out.

EDIT: Also the sleep shouldn't be needed at all. It is already at the end of the script and there is nothing to gain from hesitating.
 
#!/system/bin/sh
/system/bin/iptables -P INPUT ACCEPT
/system/bin/iptables -P OUTPUT ACCEPT
/system/bin/iptables -P FORWARD ACCEPT
/system/bin/iptables -F
/system/bin/iptables -t nat -F
/system/bin/iptables -X
/system/bin/iptables -t nat -A OUTPUT -o ppp0 -p 6 ! -d 10.133.26.12 -j REDIRECT --to-port 1025
exec /system/bin/u2nl 10.133.26.12 8080 1025

^^Thats script I have always used.
 
That's fine when exec is used on the last line. Adding anything after an exec line is like adding something after an exit line. The script is over when it reaches a line with exec/exit.

EDIT: also my script added a path line so we don't need to keep hardcoding /system/bin.

EDIT: Anything ON an exec line will happen. Anything after an exec line might as well not be there at all.
 
Thanks :D

I was hoping to hear from SyZtyM or someone else who uses the autostart apk. I guess I'll have to hold off on including this modified version in the u2nl.zip for now.
 
Testing as we speak

EDIT: Ok, its not killing autostart on boot. I even tried adding a sleep command with no luck. Strange thing is, if I manually run the script with root explorer, it kills autostart. :confused:
 
I modified the script. It's possible that it is killing grep on accident, especially if this version of kill only wants one PID at a time.

If my new script doesn't work, you can change "kill" to "kill -9", but I think this new version should be tried before doing that to be sure the -9 is needed.

EDIT: What is the path to kill? Is it /bin/kill or /system/bin/kill or something else entirely? You should be able to type "which kill" to find out.

EDIT: Oops I had the wrong file in autostart.zip. It is fixed now.
 
@whiterabbitorg Same thing. Wont kill autostart on boot. But if I manually execute it, it kills autostart.

@dajiggiest This will help with the battery life. But having SetCpu will really help with battery life.

Also, on another note semi-related. After a day's use, if you run the ps command, there is a sh*t load of u2nls running in the background. Im not sure if this kills the battery faster, runs the processor harder, or if it doesnt matter.
 
What's the path to kill?

EDIT: The extra u2nls are consuming memory, but will probably get killed off when memory is needed anyway since they will have been inactive for so long. Probably doesn't matter.
 
Back
Top