3 # This code is open for re-use per MIT license. xorg
4 # Homepage: http://www.webos-internals.org/wiki/Solution_to_App_Catalog_Installation_Limit
7 #-------------------------------------------------------------------------#
9 # 0.1.0 - original (xorg)
10 #-------------------------------------------------------------------------#
13 #-------------------------------------------------------------------------#
14 # variables: these are globally available to all functions
15 #-------------------------------------------------------------------------#
19 MEDIA=/media/internal/.apps
20 VAR=/var/usr/palm/applications # Do not change this
23 IPKG_OFFLINE_ROOT=/media/internal/.apps
24 CRYPT=/media/cryptofs/apps/usr/palm/applications
26 # TAR backups are no longer needed, recommend setting to 0
27 BACKUP=0 # set to 1 for tar backups, 0 to disable
28 BACKUPDIR=/media/internal/.appbackups
30 # This should be turned on. Only turn off if javascript is calling this script.
33 #-------------------------------------------------------------------------#
34 # exit codes for javascripts:
36 # 1 - normal usage error
37 # 100 - USB drive is mounted, cannot use mvapp
41 # 30 - link for app does not exist
45 # 10 - app name not supplied
46 # 11 - link already exists
47 # 12 - app does not exist in VAR
48 # 13 - copy failed from VAR to MEDIA
49 # 14 - removing app from VAR failed
50 # 15 - APP has attributes not supported on FAT, did not move to MEDIA
51 # 16 - APP has no json file, did not move to MEDIA
52 # 17 - APP is running, need to close the app before moving
56 # 20 - app name not supplied
57 # 21 - app doesn't exist on MEDIA
58 # 22 - tar restore failed
59 # 23 - copy from MEDIA to VAR failed (only used if tar backup doesn't exist)
60 # 24 - remove from MEDIA failed
67 #-------------------------------------------------------------------------#
69 #-------------------------------------------------------------------------#
70 # function: cleanexit - exit with cleanup items
71 #-------------------------------------------------------------------------#
76 luna-send -n 1 palm://com.palm.applicationManager/rescan {} >/dev/null 2>&1 &
78 # put / back to read only
79 mount -o remount,ro / &
81 # Uncomment if you want verbose exit codes
82 # echo "exit code: $code"
86 # end of cleanexit function
89 #-------------------------------------------------------------------------#
90 # function: usage - show command usage options
91 #-------------------------------------------------------------------------#
96 exitcode=1 # default exit code for usage, otherwise exit with incode
100 echo "mvapp link <or> ln domain.appname - move app to media, create link"
101 echo "mvapp bulkmv <or> bm - move/link many apps"
102 echo "mvapp search <or> s appname - search for apps to link/unlk/clean"
103 echo "mvapp unlink <or> ul domain.appname - restore app to var, remove link"
104 echo "mvapp clean <or> c domain.appname - remove app dir and links"
105 echo "mvapp list <or> ls - list all apps sorted by size"
106 echo "mvapp listmoved <or> lm - list apps that have been moved"
107 echo "mvapp restoreall <or> ra - restore all apps to original"
109 echo "mvapp linkemail <or> le - move email/attach to media and link"
110 echo "mvapp unlinkemail <or> ue - restore email/attach to var, rm link"
112 echo "mvapp diag <or> d - report /var usage, diagnositics"
113 echo "mvapp diag <or> d media - with size of apps on media (slow)"
114 echo "mvapp info <or> i - view mvapp homepage in phone browser"
116 echo "mvapp post135 - may need to run after 1.35 update"
120 # end of usage function
122 #-------------------------------------------------------------------------#
123 # function: info - launch the mvapp page on webosinternals
124 #-------------------------------------------------------------------------#
127 HOMEPAGE=http://www.webos-internals.org/wiki/Solution_to_App_Catalog_Installation_Limit
129 luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.browser\",\"params\":{\"scene\":\"page\",\"target\":\"$HOMEPAGE\"}} >/dev/null 2>&1
131 echo "View on the phone web browser..."
134 # end of info function
137 #-------------------------------------------------------------------------#
138 # function: cleanapp - removes symbolic links and folder in media and var
139 #-------------------------------------------------------------------------#
144 mount -o remount,rw /
146 # exit to usage if no app name supplied
149 echo "No app name supplied."
155 echo "Continue to remove all traces of $APP."
157 if [ -d $MEDIA/$APP ]
159 echo "Removing $MEDIA/$APP..."
162 echo "Nothing to remove."
168 # Continue on if PROMPTS turned off (call from outside app)
169 if [ $PROMPTS -eq 1 ]
171 echo "This will remove $APP from both...."
175 echo "FIRST ATTEMPT TO... remove the app "
176 echo "from Launcher or Homebrew installer."
178 echo -e "Are you sure you want to remove.."
179 echo -e "$APP? [y/N]: \c"
187 echo "Size of $VAR before cleanup... "
189 df -m /var |grep /var |awk '{print "/var used: "$2,"MB " $4 " - avail: " $3,"MB"}'
191 if [ -d $MEDIA/$APP ]
194 echo "Removed directory" $MEDIA/$APP
199 echo "Removed directory" $VAR/$APP
200 rm -r /var/usr/lib/ipkg/info/${APP}"*"
205 echo "Removed link" $VAR/$APP
207 if [ -f $BACKUPDIR/$APP.tgz ]
209 rm -r $BACKUPDIR/$APP.tgz
210 echo "Removed tar backup" $BACKUPDIR/$APP.tgz
214 # rescan luna in case it's needed
215 luna-send -n 1 palm://com.palm.applicationManager/rescan {} >/dev/null 2>&1
216 echo "$APP directories and links removed."
217 echo "Size of $VAR after cleanup... "
219 df -m /var |grep /var |awk '{print "/var used: "$2,"MB " $4 " - avail: " $3,"MB"}'
222 # end of cleanup function
225 #-------------------------------------------------------------------------#
226 # function: listapps - list the size of each app, sort showing largest last
227 #-------------------------------------------------------------------------#
229 echo "First number is size in KB. "
230 echo "Size of 0 is an app already linked."
232 for i in `/usr/bin/du -s * | sort -n |cut -f 2`
235 SIZE=`/usr/bin/du -s $VAR/$APP |cut -f1`
237 if [ -f $VAR/$APP/appinfo.json ]
239 TITLE=`grep title $VAR/$APP/appinfo.json |cut -d: -f2 |cut -d\" -f2`
241 echo "$SIZE - $APP - $TITLE"
245 # end of listapps function
247 #-------------------------------------------------------------------------#
248 # function: listmoved - list apps moved/linked, sort showing largest last
249 #-------------------------------------------------------------------------#
254 echo "No apps linked yet..."
258 echo "Generating list, hold please."
259 echo "This may take up to a minute..."
261 # for i in `/usr/bin/du -s * | sort -n |cut -f 2`
262 for i in `ls -tr $MEDIA`
265 SIZE=`/usr/bin/du -s $MEDIA/$APP |cut -f1`
268 if [ -f $MEDIA/$APP/appinfo.json ]
270 TITLE=`grep title $MEDIA/$APP/appinfo.json |cut -d: -f2 |cut -d\" -f2`
272 echo "$SIZE - $APP - $TITLE"
275 # end of listmoved function
278 #-------------------------------------------------------------------------#
279 # function: linkapp - move the app to media and create symbolic link
280 #-------------------------------------------------------------------------#
287 echo -e "\nNo application supplied..."
292 # Check if the app is running
293 luna-send -n 1 palm://com.palm.applicationManager/running {} 2>&1 | grep $APP >/dev/null 2>&1
296 echo -e "\n$APP is running. \nClose the app before moving."
301 if [ ! -f $VAR/$APP/appinfo.json ]
303 echo -e "\n$APP has no json file. \nRecommend not moving."
304 echo -e "\nMove anyway? [y/N]: \c"
307 [Yy]*) echo "Continuing with install...";;
308 *) code=16; return $code;;
319 echo -e "Link already exists for... \n${APP}"
323 TITLE=`grep title $VAR/$APP/appinfo.json |cut -d: -f2 |cut -d\" -f2`
325 mount -o remount,rw /
329 echo -e "\nMoving... \n$APP \n$TITLE \nto $MEDIA..."
331 echo "$APP does not exist..."
336 mount -o remount,rw /
338 echo -e "\nSize before move... "
340 df -m /var |grep /var |awk '{print "/var used: "$2,"MB " $4 " - avail: " $3,"MB"}'
344 # move over to USB drive
345 cp -rp $VAR/$APP $MEDIA >/tmp/cpresult.out 2>&1
346 if [ -s /tmp/cpresult.out ]
348 grep "cannot preserve" /tmp/cpresult.out >/dev/null 2>&1
352 echo -e "\n$APP \nCANNOT BE MOVED as it \ncontains special attributes."
353 echo "Leaving app in original location."
354 echo -e "This is not an error message. \nmvapp properly handled this."
360 echo -e "Copy failed. \nLeaving app in original location."
369 # Backup using tar if enabled
372 if [ ! -d $BACKUPDIR ]
376 echo -e "Backing up $APP $TITLE \nto $BACKUPDIR using tar..."
377 tar czf $BACKUPDIR/${APP}.tgz $VAR/$APP 2>&1 >/dev/null
383 echo -e "Remove failed. \nLeaving app in original location."
388 # create the symbolic link
389 ln -s $MEDIA/$APP $VAR/$APP
391 # rescan luna in case it's needed
392 luna-send -n 1 palm://com.palm.applicationManager/rescan {} >/dev/null 2>&1
394 echo -e "$APP \nSUCCESSFULLY moved and linked."
395 echo -e "\nSize after move... "
397 df -m /var |grep /var |awk '{print "/var used: "$2,"MB " $4 " - avail: " $3,"MB"}'
399 # end of linkapp function
402 #-------------------------------------------------------------------------#
403 # function: unlinkapp - restore the app to var and remove symbolic link
404 #-------------------------------------------------------------------------#
409 echo "No application supplied..."
413 mount -o remount,rw /
415 if [ -d $MEDIA/$APP ]
418 echo "RESTORING $APP..."
420 echo -e "\n$APP does not exist \nor was not moved.\n\n"
424 echo "Size of $VAR before move... "
426 df -m /var |grep /var |awk '{print "/var used: "$2,"MB " $4 " - avail: " $3,"MB"}'
428 # remove the old symbolic link
431 # move to original location or restore from tar if it exists
432 if [ -f $BACKUPDIR/$APP.tgz ] && [ $BACKUP -eq 1 ]
434 echo "Restoring from tar backup...."
436 tar xzf $BACKUPDIR/$APP.tgz
439 echo "Tar restore FAILED. Remove and restore app using official webOS/Pre methods."
442 rm -r $BACKUPDIR/$APP.tgz
445 echo "Restoring from $MEDIA..."
446 cp -r $MEDIA/$APP $VAR
449 echo -e "Copy FAILED. \nLeaving app in $MEDIA."
457 echo -e "Remove FAILED. \nLeaving app in $MEDIA."
462 # rescan luna in case it's needed
463 luna-send -n 1 palm://com.palm.applicationManager/rescan {} >/dev/null 2>&1
465 echo -e "$APP \nmoved and unlinked SUCCESSFULLY."
466 echo "Size after move... "
468 df -m /var |grep /var |awk '{print "/var used: "$2,"MB " $4 " - avail: " $3,"MB"}'
470 # end of unlinkapp function
472 #-------------------------------------------------------------------------#
473 # function: bulkmv - move/link many apps
474 #-------------------------------------------------------------------------#
478 echo "This allows moving many apps."
479 echo "Starting with the largest apps."
483 mount -o remount,rw /
486 for i in `/usr/bin/du -s * | sort -nr |cut -f 2`
489 SIZE=`/usr/bin/du -sh $APP |cut -f 1`
490 TITLE=`grep title $VAR/$APP/appinfo.json 2>/dev/null |cut -d: -f2 |cut -d\" -f2`
492 echo "------------------"
494 echo -e "Size of $APP \n$TITLE \nis $SIZE."
496 echo -e "\nWould you like to move and link...\n$TITLE? [y/N/q]: \c"
501 *) echo "$APP not moved."
508 # end of bulkmv function
510 #-------------------------------------------------------------------------#
511 # function: restoreall - restore all apps, back to /var
512 #-------------------------------------------------------------------------#
515 #Only confirm if PROMPT turned on. (allows outside app to call)
516 if [ $PROMPTS -eq 1 ]
519 echo "This will restore all applications back to original location"
520 echo "and remove the links. Recommend charging phone during "
521 echo "restore if battery low or if many apps to restore."
522 echo -e "Are you sure you want to continue? [y/N]: \c"
530 ls $MEDIA | while read APP
532 echo "Restoring $APP and unlinking..."
536 # end of restoreall function
538 #-------------------------------------------------------------------------#
539 # function: removetarbackups - remove entire tar backup directory
540 #-------------------------------------------------------------------------#
542 echo "Tar backups are no longer needed and waste space on /media."
543 echo "Backups are located in $BACKUPDIR"
544 echo "Type \"remove\" to remove entire backup directory: "
547 [Rr]emove) echo "Removing $BACKUPDIR..."
555 # end of removetarbackups function
557 #-------------------------------------------------------------------------#
558 # function: checklinks - check to make sure links match .apps
559 #-------------------------------------------------------------------------#
567 echo "Checking abandoned links..."
569 #ls $MEDIA |while read app
570 for app in `ls $MEDIA`
572 if [ ! -h $VAR/$app ]
575 echo "Missing link for..."
579 echo "on media.
\87Probably leftovers from"
580 echo "deleted app. Recommend removing."
582 echo "Would you like"
583 echo -e "to remove the app? [y/N]: \c"
586 [Yy]*) rm -r $MEDIA/$app;;
590 echo "Checklinks complete."
592 } #end of checklinks function
594 #-------------------------------------------------------------------------#
595 # function: diag - report var storage usage areas
596 #-------------------------------------------------------------------------#
599 ownerid=`ls -ld /media/internal |cut -d" " -f5`
600 if [ $ownerid != "root" ]
603 echo "/media/internal is not owned by root."
604 echo "Was SFTP installed? May have impact."
609 echo "Gathering diag report, hold please..."
610 if [ -d $MEDIA ] && [ $APP ]
612 mappsz=`/usr/bin/du -sm $MEDIA |cut -f1`
614 #varused=df -m /var |grep /var |awk '{print ": "$2,"MB " $4 " - avail: " $3,"MB"}'
615 varused=`df -m /var |grep /var |awk '{print $2}'`
616 varpct=`df -m /var |grep /var |awk '{print $4}'`
617 varavail=`df -m /var |grep /var |awk '{print $3}'`
618 echo "var used: ${varused}MB $varpct"
619 echo "var available: ${varavail}MB"
621 appsz=`/usr/bin/du -sm $VAR |cut -f1`
622 echo "app used: ${appsz}MB on /var"
624 numapps=`ls $VAR |wc -l`
625 echo "# total apps: $numapps"
629 nummapps=`ls $MEDIA |wc -l`
630 numvapps=`expr $numapps - $nummapps`
631 echo "# var apps: $numvapps"
632 echo "# media apps: $nummapps"
635 if [ -d $MEDIA ] && [ $APP ]
637 echo "app used: ${mappsz}MB on /media"
638 nummapps=`ls $MEDIA |wc -l`
639 echo "# media apps: $nummapps"
642 if [ -h /var/luna/data/emails ]
644 emailsz=`/usr/bin/du -sm /media/internal/.data/emails |cut -f1`
645 attachsz=`/usr/bin/du -sm /media/internal/.data/attachments |cut -f1`
646 echo "email used: ${emailsz}MB on /media"
647 echo "attachmnt used: ${attachsz}MB on /media"
649 emailsz=`/usr/bin/du -sm /var/luna/data/emails |cut -f1`
650 attachsz=`/usr/bin/du -sm /var/luna/data/attachments |cut -f1`
651 echo "email used: ${emailsz}MB on /var"
652 echo "attach used: ${attachsz}MB on /var"
655 softtemp=`/usr/bin/du -sm /var/lib/software/tmp |cut -f1`
656 echo "var tmp used: ${softtemp}MB"
661 optsz=`/usr/bin/du -sm /opt |cut -f1`
662 echo "opt used: ${optsz}MB"
665 ipkglist=`/usr/bin/du -sm /var/usr/lib/ipkg/lists |cut -f1`
666 echo "ipkg lists: ${ipkglist}MB"
669 echo "Recommendations..."
671 echo "- Keep \"var used\" well below 125MB."
674 if [ $varused -gt "125" ]
677 echo "- Consider reducing space on /var."
678 echo "/var use is greater than 125MB."
680 if [ $softtemp -gt 1 ]
683 echo "- Check Updates app."
684 echo "/var/lib/software/tmp is larger"
685 echo "than it should be. May have an"
686 echo "update waiting to be applied."
689 if [ $appsz -gt "20" ] && [ $varused -gt 125 ]
692 echo "- Consider moving apps: mvapp bulkmv"
695 totalsz=`expr $emailsz + $attachsz`
696 if [ ! -h /var/luna/data/emails ] && [ $totalsz -gt "10" ]
699 echo "- Consider moving email: mvapp linkemail"
701 if [ $optsz -gt 10 ] && [ $varused -gt 125 ]
704 echo "- Consider removing optware packages."
705 echo "You have optware software installed."
706 echo "See: ipkg-opt list_installed"
707 echo " Do: ipkg-opt remove ipkg"
708 echo "Ask on PreCentral."
710 if [ $ipkglist -gt 10 ]
713 echo "- ipkg list size is rather large."
714 echo "check /var/usr/lib/ipkg/lists"
715 ls -l |awk '{print $5 "\t" $9}'
721 echo "This report is available on media"
722 echo "drive as... diagreport.rtf"
723 } # end of diag function
725 #-------------------------------------------------------------------------#
726 # function: linkemail - move/link email and attachments to /media
727 #-------------------------------------------------------------------------#
730 mdata=/media/internal/.data
732 echo "This will move email and attachments"
733 echo "to the media drive. It is unknown"
734 echo "if there will be email issues when"
735 echo "Palm upgrades webOS. See \"mvapp "
736 echo "info\" for details."
738 echo "If you are writing a new email,"
739 echo "complete and send before continuing."
741 echo -e "Do you want to continue? [y/N]: \c"
748 if [ -h $vdata/emails ]
750 echo "email link already exists."
754 echo "Closing email application and background service..."
755 luna-send -n 1 palm://com.palm.applicationManager/running {} 2>&1 \
756 | tr '{' '\n' | grep com.palm.app.email |cut -d: -f3 |cut -d"\"" -f2 \
760 luna-send -n 1 "palm://com.palm.applicationManager/close" "{\"processId\":\"$it\"}"
770 #move email to media and create link
771 echo "Do not close Terminal during moves."
772 echo "Moves could take several minutes."
773 echo "Moving/linking email. "
774 cp -rp $vdata/emails $mdata 2>&1 >/tmp/cpemail.out
775 if [ -s /tmp/cpemail.out ]
777 echo "Copying email failed. Leaving email in place."
780 #mv $vdata/emails $vdata/emails.$$
782 ln -s $mdata/emails $vdata/emails
785 #move attachments to media and create link
786 echo "Moving/linking attachments..."
787 cp -rp $vdata/attachments $mdata 2>&1 >/tmp/cpemail.out
788 if [ -s /tmp/cpemail.out ]
790 echo "Copying attachments failed. Leaving attachments in place."
793 #mv $vdata/attachments $vdata/attachments.$$
794 rm -r $vdata/attachments
795 ln -s $mdata/attachments $vdata/attachments
797 #starup email process
798 echo "Starting up email..."
799 luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.email\"} >/dev/null 2>&1
802 echo "SUCCESSFUL: Confirm you can access your email."
804 echo "NOTE: First time you run email,"
805 echo "it may ask if you want to add "
806 echo "accounts. Press Done."
808 } #end of link email function
810 #-------------------------------------------------------------------------#
811 # function: unlinkemail - move email and attachments to /media
812 #-------------------------------------------------------------------------#
815 mdata=/media/internal/.data
818 if [ ! -d $mdata/emails ]
820 echo "no email on media"
824 if [ ! -h $vdata/emails ]
826 echo "email link does not exist on /var"
830 echo "Closing email application and background service..."
831 luna-send -n 1 palm://com.palm.applicationManager/running {} 2>&1 \
832 | tr '{' '\n' | grep com.palm.app.email |cut -d: -f3 |cut -d"\"" -f2 \
836 luna-send -n 1 "palm://com.palm.applicationManager/close" "{\"processId\":\"$it\"}"
839 echo "Do not close Terminal during restore."
840 echo "Restore could take several minutes."
841 echo "Restoring email to /var..."
844 # cp email from media to var
845 cp -rp $mdata/emails $vdata 2>&1 >/tmp/cpemail.out
846 if [ -s /tmp/cpemail.out ]
848 echo "copying email back to /var failed."
853 echo "Restoring attachments to /var..."
854 # rm the attachment link
855 rm $vdata/attachments
856 # cp attachments from media to var
857 cp -rp $mdata/attachments $vdata 2>&1 >/tmp/cpemail.out
858 if [ -s /tmp/cpemail.out ]
860 echo "copying attachments back to /var failed."
864 rm -r $mdata/attachments
866 #starup email process
867 echo "Starting up email..."
868 luna-send -n 1 palm://com.palm.applicationManager/launch {\"id\":\"com.palm.app.email\"} >/dev/null 2>&1
871 echo "SUCCESSFUL: Confirm you can access your email."
873 } #end of unlinkemail function
875 #-------------------------------------------------------------------------#
876 # function: search - search for partial app names
877 #-------------------------------------------------------------------------#
882 for i in `ls -dt $VAR/*${APP}* $MEDIA/*${APP}* |sort `
885 if [ -f $i/appinfo.json ]
887 TITLE=`grep title $i/appinfo.json |cut -d: -f2 |cut -d\" -f2`
897 echo "App is currently linked to media."
899 if [ -d $MEDIA/$APP ]
901 echo "App is on media drive but has no link."
903 echo "App is in original location, not linked."
907 echo -e "\nWould you like to link/unlink/clean/skip this app? [l/u/c/S/q]: \c"
911 u) mvapp unlink $APP;;
912 c) mvapp clean $APP;;
916 echo -e "\n\n---------------------\n"
922 } #end of search function
925 #-------------------------------------------------------------------------#
926 # function: removelinks - remove links from var app dir
927 #-------------------------------------------------------------------------#
930 echo "This will remove all links from /var"
931 echo -e "Are you sure you want to continue? [y/N]:\c"
944 echo "$count - $app has a link"
945 count=`expr $count + 1`
952 #-------------------------------------------------------------------------#
953 # function: post135 - move apps to /media/cryptofs
954 #-------------------------------------------------------------------------#
957 echo "This will copy all linked apps"
958 echo "to the new app location."
960 echo "Large applications may take up"
961 echo "to a minute or so each to copy."
963 echo "Do not close the Terminal app."
968 if [ ! -d /media/cryptofs/apps/usr/palm/applications ]
970 echo "/media/cryptofs does not exist"
974 if [ ! -d /media/internal/.apps ]
976 echo "media/internal/.apps does not exist"
980 cd /media/internal/.apps
982 echo "Copying $numapps linked"
983 echo "applications to new app home..."
990 cp -rp $app /media/cryptofs/apps/usr/palm/applications
993 echo "Copy failed. Check PreCentral thread."
994 export error=`expr $error +1`
996 count=`expr $count - 1`
1001 echo "There were $error copy error(s)."
1002 echo "Ask on PreCentral mvapp thread."
1006 echo "Copy complete."
1007 echo "Check applications."
1008 echo "If issues, see PreCentral mvapp thread."
1013 #-------------------------------------------------------------------------#
1014 # function: backup - perform tar backups
1015 #-------------------------------------------------------------------------#
1018 echo "Performing backups of all apps..."
1019 cd /var/usr/palm/applications
1020 tar cvzf /media/internal/varappbackups.tgz .
1022 if [ -d /media/internal/.apps]
1024 cd /media/internal/.apps
1025 tar cvzf /media/internal/mediaappbackups.tgz .
1028 if [ -d /media/internal/.data ]
1030 echo "Backing up email and attachments."
1031 cd /media/intenral/.data
1032 tar cvzf /media/internal/mediaemail.tgz .
1035 echo "You may now perform the webOS update."
1038 #-------------------------------------------------------------------------#
1039 # function: checkfd - check if fair dinkum is installed
1040 #-------------------------------------------------------------------------#
1042 if [ -f /usr/local/bin/ipkg ]
1044 echo "Fair Dinkum is installed and enabled."
1046 echo "Fair Dinkum is NOT installed or enabled."
1049 ipkg -o /var list_installed |grep ipkgservice
1050 ipkg -o /var list_installed |grep preware
1054 #-------------------------------------------------------------------------#
1055 # function: install latest development version
1056 #-------------------------------------------------------------------------#
1058 echo "Installing latest development version."
1059 echo "Use \"ma\" instead of \"mvapp\"."
1061 wget http://gitorious.org/webos-internals/mvapp/blobs/raw/master/mvapp
1063 mv mvapp /usr/local/bin/ma
1064 echo "Done. Type... ma"
1065 } #end of installdev function
1068 #-------------------------------------------------------------------------#
1069 # function: updatepreware - update to latest version of preware
1070 #-------------------------------------------------------------------------#
1075 wget http://gitorious.org/webos-internals/bootstrap/blobs/raw/master/preware-bootstrap.sh
1076 #Alternatively, you can use this tiny URL: http://bit.ly/dDEMO
1077 sh preware-bootstrap.sh
1079 echo "PreWare update complete..."
1083 #-------------------------------------------------------------------------#
1084 # function: updateterminal - update to latest version of terminal
1085 #-------------------------------------------------------------------------#
1089 ipkg -o /var install org.webosinternals.termplugin
1090 ipkg -o /var install org.webosinternals.terminal
1095 #-------------------------------------------------------------------------#
1096 # function: startup - startup items
1097 #-------------------------------------------------------------------------#
1102 echo "mvapp version: $VERSION"
1104 mount -o remount,rw /
1106 #create shortcut 'm'
1107 if [ ! -h /usr/local/bin/m ]
1110 echo "Created shortcut to mvapp."
1111 echo "Can now use just 'm' to run 'mvapp'."
1113 ln -s /usr/local/bin/mvapp /usr/local/bin/m
1116 df |grep /media/internal 2>&1 >/dev/null
1119 echo "USB drive is mounted to computer. You must unmount from USB to use mvapp."
1125 # end of startup function
1127 #-------------------------------------------------------------------------#
1128 # commander - command handler via command line or menu
1129 #-------------------------------------------------------------------------#
1156 "ftr") # force tar restore
1160 "rtb") # remove all tar backups
1167 diag |tee /media/internal/diagreport.rtf
1187 "upw"|"updatepreware")
1190 "upt"|"updateterminal")
1209 #-------------------------------------------------------------------------#
1210 # mainmenu - the main menu
1211 #-------------------------------------------------------------------------#
1218 echo "xorg tools - Power Tools for Power Users"
1219 echo "xt - $VERSION"
1222 d) diagnostics ma) mvapp functions
1223 db) debian tools op) optware tools
1225 q) quit cp) command prompt
1228 echo -e "Enter Selection: \c"
1234 echo -e "Press ENTER to continue: \c"
1243 #-------------------------------------------------------------------------#
1244 # main - begins here
1245 #-------------------------------------------------------------------------#