Pages: [1]   Go Down
  Print  
Author Topic: GScript Examples and discussions  (Read 675 times)
0 Members and 1 Guest are viewing this topic.
Qman
Administrator
Jr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 90


View Profile
« on: February 21, 2010, 01:45:46 AM »

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.
Code:
#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)
Code:
#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
« Last Edit: February 21, 2010, 01:50:41 AM by Qman » Logged
Pages: [1]   Go Up
  Print  
 
Jump to: