[Android Software/Hacking General [Developers Only]] gu5t3r:
+ echo zOOM... zOOM...
zOOM... zOOM...
+ echo ================================================
================================================
+ echo -=Engine Flush-O-Matic=- by -=zeppelinrox=-
-=Engine Flush-O-Matic=- by -=zeppelinrox=-
+ echo ================================================
================================================
+ echo

+ busybox sleep 1
+ id
+ id=uid=0(root) gid=0(root)
+ id=0(root) gid=0(root)
+ id=0
+ grep /!FastEngineFlush.sh
+ busybox ps -w
20667 root 1280 S sh /data/V6_SuperCharger/!FastEngineFlush.sh
20761 root 1204 S grep /!FastEngineFlush.sh
+ grep /!FastEngineFlush.sh
+ wc -l
+ busybox ps -w
2
+ grep /!FastEngineFlush.sh
+ busybox ps -w
+ grep -v grep
20667 root 1280 D sh /data/V6_SuperCharger/!FastEngineFlush.sh
+ grep /!FastEngineFlush.sh
+ grep -v grep
+ wc -l
+ busybox ps -w
1
+ [ 0 != 0 ]
+ grep /!FastEngineFlush.sh
+ busybox ps -w
+ wc -l
+ [ 3 -lt 3 ]
+ wc -l
+ grep /!FastEngineFlush.sh
+ busybox ps -w
+ [ 3 -gt 2 ]
+ echo -=Engine Flush-O-Matic=- is already in memory!
-=Engine Flush-O-Matic=- is already in memory!
+ echo

+ sleep 1
+ echo Do you want to flush now anyway?
Do you want to flush now anyway?
+ echo

+ sleep 1
+ echo If you do, you can access Options too...
If you do, you can access Options too...
+ echo

+ sleep 1
+ echo ...but you can't enter another "Flush Cycle".
...but you can't enter another "Flush Cycle".
+ echo

+ sleep 1
+ echo -n Enter Y for Yes, any key for No:
Enter Y for Yes, any key for No: + stty -icanon min 0 time 200
+ read FOMactive
Y^J+ stty sane
+ [ ! Y ]
+ echo

+ echo ================================================
================================================
+ echo Alrighty Then!
Alrighty Then!
+ echo ================================================
================================================
+ echo

+ sleep 1
+ :
+ free
+ sed -n 2p
+ awk { print $2 }
+ ram=341
+ sed -n 2p
+ awk { print $3 }
+ free
+ ramused=282
+ sed -n 2p
+ awk { print $4 }
+ free
+ ramkbytesfree=60772
+ awk {print $2}
+ grep Cached
+ sed -n 1p
+ cat /proc/meminfo
+ ramkbytescached=37908
+ ramfree=59
+ ramcached=37
+ ramreportedfree=96
+ echo Note that "Used RAM" INCLUDES Cached Apps!!
Note that "Used RAM" INCLUDES Cached Apps!!
+ echo

+ sleep 1
+ echo ================================================
================================================
+ echo RAM Stats BEFORE Engine Flush...
RAM Stats BEFORE Engine Flush...
+ echo ================================================
================================================
+ echo

+ sleep 1
+ echo Total: 341 MB Used: 282 MB True Free: 59 MB
Total: 341 MB Used: 282 MB True Free: 59 MB
+ echo

+ sleep 1
+ echo Reported Free by most tools: 96 MB Free RAM!
Reported Free by most tools: 96 MB Free RAM!
+ echo

+ sleep 1
+ echo ================================================
================================================
+ echo True Free 59 MB = "Free" 96 - Cached Apps 37
True Free 59 MB = "Free" 96 - Cached Apps 37
+ echo ================================================
================================================
+ echo

+ sleep 1
+ echo ...OR... True Free RAM 59
...OR... True Free RAM 59
+ echo Cached Apps + 37
Cached Apps + 37
+ echo ========
========
+ echo Reported "Free" RAM = 96 MB
Reported "Free" RAM = 96 MB
+ echo

+ sleep 1
+ busybox sync
+ echo ================================================
================================================
+ echo -n Engine Flush In Progress...
Engine Flush In Progress... + busybox sysctl -w vm.drop_caches=3
vm.drop_caches = 3
+ echo ================================================
================================================
+ echo

+ sleep 3
+ busybox sysctl -w vm.drop_caches=1
+ awk { print $3 }
+ free
+ sed -n 2p
+ ramused=276
+ sed -n 2p
+ free
+ awk { print $4 }
+ ramkbytesfree=66672
+ cat /proc/meminfo
+ grep Cached
+ awk {print $2}
+ sed -n 1p
+ ramkbytescached=33308
+ ramfree=65
+ ramcached=32
+ ramreportedfree=97
+ echo ================================================
================================================
+ echo ...RAM Stats AFTER Engine Flush
...RAM Stats AFTER Engine Flush
+ echo ================================================
================================================
+ echo

+ sleep 1
+ echo Total: 341 MB Used: 276 MB True Free: 65 MB
Total: 341 MB Used: 276 MB True Free: 65 MB
+ echo

+ sleep 1
+ echo Reported Free by most tools: 97 MB Free RAM!
Reported Free by most tools: 97 MB Free RAM!
+ echo

+ sleep 1
+ echo ================================================
================================================
+ echo True Free 65 MB = "Free" 97 - Cached Apps 32
True Free 65 MB = "Free" 97 - Cached Apps 32
+ echo ================================================
================================================
+ echo

+ sleep 1
+ echo ...OR... True Free RAM 65
...OR... True Free RAM 65
+ echo Cached Apps + 32
Cached Apps + 32
+ echo ========
========
+ echo Reported "Free" RAM = 97 MB
Reported "Free" RAM = 97 MB
+ echo

+ sleep 1
+ echo ================================================
================================================
+ echo ...Enjoy Your Quick Boost ;^]
...Enjoy Your Quick Boost ;^]
+ echo ================================================
================================================
+ echo

+ sleep 1
+ [ 4 -ne 0 ]
+ echo =====================================
=====================================
+ echo ) Engine Flush-O-Matic Completed! (
) Engine Flush-O-Matic Completed! (
+ echo =====================================
=====================================
+ echo

+ sleep 1
+ echo If desired, you can change options for...
If desired, you can change options for...
+ echo

+ sleep 1
+ echo ================================================
================================================
+ echo -=Engine Flush-O-Matic=-
-=Engine Flush-O-Matic=-
+ echo ================================================
================================================
+ echo

+ sleep 1
+ echo Current Status...
Current Status...
+ echo

+ sleep 1
+ [ 4 -ne 0 ]
+ echo Engine Flush-O-Matic is ON @ 4 hour intervals!
Engine Flush-O-Matic is ON @ 4 hour intervals!
+ echo ==============================================
==============================================
+ echo

+ sleep 1
+ echo You can turn it on or off...
You can turn it on or off...
+ echo

+ sleep 1
+ echo ...or just change how often it runs ;^]
...or just change how often it runs ;^]
+ echo

+ sleep 1
Note that when it's enabled...

================================================
-=Engine Flush-O-Matic=- on boot is AUTOMATIC!
================================================

Since it is loaded via *99SuperCharger... heh.

+ echo Change Options? You have 20 seconds to decide!
Change Options? You have 20 seconds to decide!
+ echo

+ sleep 1
+ echo -n Enter Y for Yes, any key for No:
Enter Y for Yes, any key for No: + [ Y ]
+ changeoptions=Y
+ echo Y
Y
+ echo

+ echo ================================================
================================================
+ changedopt=yes
+ mount -o remount,rw /system
+ busybox mount -o remount,rw /system
+ grep system
+ busybox mount
+ awk {print $1,$3}
+ sed -n 1p
+ busybox mount -o remount,rw /dev/block/mtdblock0 /system
+ echo -=Engine Flush-O-Matic=- Options
-=Engine Flush-O-Matic=- Options
+ :
+ echo ================================================
================================================
+ echo

+ sleep 1
+ echo -n Enter E to Enable, D to Disable:
Enter E to Enable, D to Disable: + read able
E
+ echo

+ echo ================================================
================================================
+ echo -=Engine Flush-O-Matic=- ENABLED!!
-=Engine Flush-O-Matic=- ENABLED!!
+ echo ================================================
================================================
+ echo

+ sleep 1
+ echo How often do you want it to flush?
How often do you want it to flush?
+ :
+ echo

+ sleep 1
+ echo -n Enter a value from 1 to 24 (hours):
Enter a value from 1 to 24 (hours): + read flushOmaticHours
4
+ echo

+ echo ================================================
================================================
+ echo Engine Flush-O-Matic Set To Run Every 4 Hours!
Engine Flush-O-Matic Set To Run Every 4 Hours!
+ break 2
+ sed -i s/^flushOmaticHours=.*/flushOmaticHours=4/ /data/V6_SuperCharger/!FastEngineFlush.sh
+ mount -o remount,ro /system
+ busybox mount -o remount,ro /system
+ awk {print $1,$3}
+ grep system
+ busybox mount
+ sed -n 1p
+ busybox mount -o remount,ro /dev/block/mtdblock0 /system
+ echo ================================================
================================================
+ echo

+ sleep 1
+ [ 4 -eq 0 ]
+ echo ================================================
================================================
-=Engine Flush-O-Matic=- is already in memory!
================================================

69|root@android:/sdcard #

---------- Post added at 10:23 PM ---------- Previous post was at 09:39 PM ----------

If I change -lt 3 to -lt 4 the script works....

But what bugs me is this part

if [ "`busybox ps$w | grep "{.*}.*${0##*/}" | wc -l`" -gt 1 ]; then echo "cookie!" > /data/FOMtemp; $0 & exit
elif [ "`busybox --help | grep nohup`" ]; then echo "cookie!" > /data/FOMtemp; (busybox nohup $0 > /dev/null &); break
elif [ "`busybox --help | grep start-stop-daemon`" ]; then echo "cookie!" > /data/FOMtemp; busybox start-stop-daemon -S -b -x $0; break

Script Loops itself, shouldn't it supposed to die and run in background with no-hup?