Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,781,073 Members 44,900 Now Online
XDA Developers Android and Mobile Development Forum

GScript * Easily launch/save shell scripts from within Android UI * - Useful scripts

Tip us?
 
rogro82
Old
(Last edited by rogro82; 3rd March 2009 at 08:13 PM.)
#1  
rogro82's Avatar
Senior Recognized Developer - OP
Thanks Meter 440
Posts: 862
Join Date: May 2008

 
DONATE TO ME
Default GScript * Easily launch/save shell scripts from within Android UI * - Useful scripts

As some of you might have seen or even used, I have created an application that allows executing of shell scripts from within Android and it will even allow you to create a direct shortcut on your homescreen to a script ( for example to start Debian or reboot your phone ).

I know a lot of developers ( I also didnt at first ) don't look in the "applications and games" section, but i thought it was the best place to post the actual application.

I will keep updating that post with the actual application process/updates, but ive created this thread to see if people ( I think most of the actual linux experienced people are in this section ) would like to share their linux knowledge to other peoples uploading useful .sh files ( for backing up stuff etc etc ), so that less experienced can just load them in to my application, without risking all typos.

So if you have a nice script that is useful please upload it so we can all benefit from it.

The actual application can be found here:
http://forum.xda-developers.com/showthread.php?t=486486

Please dont ask question or place suggestions about the application in this thread, but use the one Ive created for the actual development and keep this thread for scripts only.

Regards,

Rob
Google+ | Twitter | GitHub

Most recent devices
Samsung Galaxy Note | Samsung Galaxy Nexus | HTC OneX | Sony NSZ-GS7

Notice: I do not respond to tech support questions through PM.
 
the.snks
Old
(Last edited by the.snks; 5th March 2009 at 09:22 PM.) Reason: clarity
#2  
Member
Thanks Meter 3
Posts: 97
Join Date: Jan 2009
I was thinking about starting a thread just like this one-- for everyone to post up their scripts. Don't know why I didn't. Anyway, I asked the question awhile back how to create a script for remounting the file system as read/write, which led to my discovery of GScript. In any case, here's what I was told to use:

Quote:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Be advised that I have no idea if this actually works or not. Perhaps someone could test and post the results?
 
Gary13579
Old
#3  
Gary13579's Avatar
Retired Moderator
Thanks Meter 61
Posts: 520
Join Date: Nov 2008
Quote:
Originally Posted by tubaking182 View Post
that takes to long, i find it easier when i am using the comp to just click my terminal(which is almost always up and running) and type reboot_phone(i have a script on the computer that contains the comand adb shell reboot) and also another for rebooting into recovery and one more for bootloader

i guess i'm lazy but if i can find a way to automate anything i do in life i go ahead and do it. i have a script for nearly everything i do to my phone.

on a more on-topic note, i was hoping someone would post the command to reboot and apply an update.zip, i know it is in the JF autoupdater, but i just want to be able to hit a shortcut on my home screen to apply themes as well.
Code:
su
echo "boot-recovery
--update_package=/sdcard/update.zip" > /cache/recovery/command
reboot recovery
Untested, you might have to play around with the /sdcard/update.zip to get it to load properly, I'm not sure exactly how you put the path in there. This will, for sure, reboot it into recovery mode, and tries to automatically apply an update.zip.

Edit:
--update_package=sdcard:update.zip

Should do it. I hope.
 
benmyers2941
Old
#4  
benmyers2941's Avatar
Senior Member
Thanks Meter 8
Posts: 363
Join Date: Oct 2007
Location: Phoenix, AZ
Here's a script I built to make a rom into the "lite" version needed by many of the themes. It's not much but it's my first one.

Code:
mount -o rw,remount -t yaffs2, /dev/block/mtdblock /system
rm -r /system/media/audio/ringtones
rm -r /system/media/audio/notifications
reboot
Attached Files
File Type: zip Make Lite.zip - [Click for QR Code] (215 Bytes, 455 views)
 
benmyers2941
Old
#5  
benmyers2941's Avatar
Senior Member
Thanks Meter 8
Posts: 363
Join Date: Oct 2007
Location: Phoenix, AZ
Quote:
Originally Posted by Gary13579 View Post
Code:
su
echo "boot-recovery
--update_package=/sdcard/update.zip" > /cache/recovery/command
reboot recovery
Untested, you might have to play around with the /sdcard/update.zip to get it to load properly, I'm not sure exactly how you put the path in there. This will, for sure, reboot it into recovery mode, and tries to automatically apply an update.zip.

Edit:
--update_package=sdcard:update.zip

Should do it. I hope.
You don't need the "su" at the beginning. Gscript has a checkbox to indicate if SU is needed and will add it on it's own. Putting it in causes the script to hang.
 
KyleK29
Old
#6  
Senior Member
Thanks Meter 17
Posts: 443
Join Date: Oct 2006
Anyway to make it close the script window when the script completes? Right now I have it doing an app backup and echoing DONE. But I'd like to automate the process if possible.

Exit doesn't seem to work.
 
wpbcubsfan
Old
#7  
Senior Member
Thanks Meter 9
Posts: 177
Join Date: Jun 2008
Location: Chicago
Quote:
Originally Posted by Gary13579 View Post
Code:
su
echo "boot-recovery
--update_package=/sdcard/update.zip" > /cache/recovery/command
reboot recovery
Untested, you might have to play around with the /sdcard/update.zip to get it to load properly, I'm not sure exactly how you put the path in there. This will, for sure, reboot it into recovery mode, and tries to automatically apply an update.zip.

Edit:
--update_package=sdcard:update.zip

Should do it. I hope.
It does reboot into recovery mode but I get the error "Can't mount /sdcard/Update.zip Installation aborted."

I'm able to just apply the update by pressing Alt+S but would be nice if it was all automated.
 
beagz
Old
#8  
beagz's Avatar
Senior Member
Thanks Meter 23
Posts: 1,056
Join Date: Jan 2009
Location: Greenacres, FL
Quote:
Originally Posted by wpbcubsfan View Post
It does reboot into recovery mode but I get the error "Can't mount /sdcard/Update.zip Installation aborted."

I'm able to just apply the update by pressing Alt+S but would be nice if it was all automated.
Same result for me.
 
beagz
Old
(Last edited by beagz; 18th March 2009 at 08:58 PM.) Reason: shortcut:
#9  
beagz's Avatar
Senior Member
Thanks Meter 23
Posts: 1,056
Join Date: Jan 2009
Location: Greenacres, FL
Default Got it!!!

ok!

used this as script to change theme

cp /sdcard/themes/aero/update.zip /sdcard/
echo "boot-recovery
--update_package=SDCARD:update.zip" > /cache/recovery/command
reboot recovery


Needed to use caps for SDCARD!!!

found it poking around the recovery.c file

better still no need to copy over update.zip in root Just in case of emergency.
Code:
echo "boot-recovery
--update_package=SDCARD:themes/aero/update.zip" > /cache/recovery/command
reboot recovery
 
wpbcubsfan
Old
#10  
Senior Member
Thanks Meter 9
Posts: 177
Join Date: Jun 2008
Location: Chicago
Quote:
Originally Posted by beagz View Post
ok!

used this as script to change theme

cp /sdcard/themes/aero/update.zip /sdcard/
echo "boot-recovery
--update_package=SDCARD:update.zip" > /cache/recovery/command
reboot recovery


Needed to use caps for SDCARD!!!

found it poking around the recovery.c file

better still no need to copy over update.zip in root Just in case of emergency.
Code:
echo "boot-recovery
--update_package=SDCARD:themes/aero/update.zip" > /cache/recovery/command
reboot recovery
Dude, you rock! Thanks!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes