BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/index.php)
-   Linux Users Corner (http://www.blackberryforums.com/forumdisplay.php?f=83)
-   -   Script: Download OTA app to install from SD card (http://www.blackberryforums.com/showthread.php?t=125874)

rivviepop 04-18-2008 12:01 PM

Script: Download OTA app to install from SD card
 
A utilitarian script to download a large OTA app and all it's COD/JAR/JAD files - such as the Mobipocket Reader - to your workstation so you can install it on your device using your SD card instead; handy if the app is really large, have problems with your device data connection, or pay a lot for the data usage on your device. Usage is simple and easy:

Download Usage

1) save the below code as 'getapp.sh'
2) edit getapp.sh to put in the proper URL and JAD file (Mobipocket eReader used as an example)
3) comment/uncomment the use of wget or curl as needed (depends on what you have installed, I like curl)
4) make a new directory and run the script in that directory

Example:
Code:

cd ~
vi getapp.sh (edit/save/exit)
mkdir mpocket
cd mpocket
sh ../getapp.sh


Install Usage

1) copy the folder "mpocket" to your SD card, it should contain all the random COD, JAD and JAR files
2) from your device launch the Media applet
3) Menu key -> Explore -> Media Card -> mpocket folder
4) click on the JAD file to start the install (i.e. mobireader.jad)


getapp.sh
Code:

#!/bin/sh
#
# retrieve an OTA app locally, copy to SD card and install
# from there instead (for large OTA apps)

URL=http://www.mobipocket.com/mobile/downloadsoft/download/mobile4.2.0/
JAD=mobireader.jad

# curl or wget may be used, comment/uncomment as needed
#CMD="wget --quiet"
CMD="curl -s -O"

echo "Retrieving: ${URL}${JAD}"
${CMD} "${URL}${JAD}"

echo "Converting ${JAD}"
dos2unix "${JAD}"

CODS=`cat ${JAD} | grep -i url | cut -f2 -d ' '`
for ii in ${CODS}; do
  echo "Retrieving: ${URL}${ii}"
  ${CMD} "${URL}${ii}"
done

exit 0

# rivviepop at blackberryforums.com
# licensed under the GPLv2

getapp.sh: download OTA app to install from SD card « rivviepop phantom :: knowledge in passing

ma077146 04-18-2008 12:32 PM

Very useful, thanks for posting this.

rivviepop 04-18-2008 12:53 PM

My pleasure - I needed it to download a large (> 1meg) OTA app myself this morning to test for a developer, so as they say - necessity is the mother of invention. :)

John Clark 04-18-2008 06:20 PM

Stuck thread.

rivviepop 04-18-2008 10:48 PM

Quote:

Originally Posted by John Clark (Post 900406)
Stuck thread.

gracias!

rexxxlo 07-08-2008 10:43 PM

i love the way inux works i use ubuntu on my deskop and asus eee but when i get in to these codes i get worried

is there a list of what most of this means somewhere?

rivviepop 07-08-2008 10:50 PM

Quote:

Originally Posted by rexxxlo (Post 1006841)
i love the way inux works i use ubuntu on my deskop and asus eee but when i get in to these codes i get worried

is there a list of what most of this means somewhere?

Well there's not a 'list' per se, as it's an entire language called Bourne Shell. You can read a beginner and advanced guide at these links:

http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://tldp.org/LDP/abs/html/index.html

Other great resources:

http://wooledge.org:8000/BashFAQ?act...direct=BashFaq
Heiner's SHELLdorado
Bash Reference Manual
All about Linux: Bash Shell Shortcuts

mcjohn87 08-10-2009 03:17 AM

thanks
 
thanks so much for useful info

mcjohn87 08-10-2009 03:18 AM

i love the way inux works i use ubuntu on my deskop and asus eee but when i get in to these codes i get worried


All times are GMT -5. The time now is 01:52 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.