This is a companion thread to the article "Automating Tasks with GScript - An Overview" located at
http://www.absolutelyandroid.com/automating-tasks-with-gscript-an-overview/ .
That post is a guide to installing and loading scripts.
This thread will contain examples and discussion of the use of these scripts. In addition to the examples here visit
http://forum.xda-developers.com/showthread.php?t=488928.
REMINDER: PLEASE UNDERSTAND WHAT THE SCRIPT YOU RUN WILL DO. THE RESPONSIBILITY IS YOURS ALONE.
Here are a couple of links to references for useful commands
http://www.freeos.com/articles/4414/http://www.computerhope.com/unix.htm#02 Here are a couple of scripts to start us off
Reboot Recovery which can be especially useful on the Nexus as it currently takes two steps.
#this script will simply reboot your phone into recovery
reboot recovery
Clear the battery stats and Reboot (requires superuser access). This script is courtesy of @JAguirre1231 with a slight modification (removal of reference to QMan's GodPhone and addition of comments)
#mounts the system directory in read/write
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
#removes the battery stats file
rm /data/system/batterystats.bin
#displays quoted phrase
echo "All Done"
echo " "
echo " "
echo " "
echo " "
echo " "
echo " "
echo " "
echo " "
echo " "
echo " "
echo " "
echo " "
#reboots the phone
reboot
Adding -p as an option to the reboot command at the end of this script results in a shutdown instead of a reboot.
Please feel free to add any other scripts that can be shared with other Absolutely Android forum members and guests