3 ## New! Ask where the user wishes to install the package with gxmessage:
5 export GXMSG=`printf "\
6 Where do you want your Mer image installed?
7 You need approximately 1.3GB initially.\n\
8 Free space left on your memory cards:\n\n"; \
9 df -h | grep "media\/mmc" | awk '{print $6 ": " $4 " free, " $2 " total (" $5 " full)"}' | sort`
10 gxmessage -center -buttons MMC1:1,MMC2:2 -geometry 690x380 -title "Choose Memory Card" "$GXMSG"
22 echo "Downloading and extracting to /media/$SDCARD..."
26 ## HERE ARE THE VARIABLES:
28 export INSTPATH="/home/user/img-install"
29 export TARPATH="/media/$SDCARD"
30 export DLURL="http://qole.org/files"
31 export BZ2CMD1="bunzip2"
34 export EXTPATH1=$TARPATH
35 export PKGNAME1="EASY MER IMAGE FILE"
36 export BIGTAR1="easy-mer-015-1-img.bz2"
37 export MD51="7eb7864526f157fb352438e460746a53"
38 export EXTCMD1="mv $TARPATH/easy-mer-015-1-img $TARPATH/mer_015-1.img.ext2"
39 export TARCMD1="$BZ2CMD1 $TARPATH/$BIGTAR1 $BZ2CMD2"
41 #export CLEANUP="sudo rm -r $INSTPATH ; sudo rm /usr/share/applications/image-install.desktop "
42 export CLEANUP="echo All done!"
46 # Download first package
50 if [ -f $TARPATH/$BIGTAR1 ] ; then
51 echo You already have the big image file!
52 echo Checking to see if it is good...
53 if [ "`$INSTPATH/md5sum $TARPATH/$BIGTAR1 | awk '{print $1}'`" = "$MD51" ] ; then
64 while test $TEST != $GOOD
67 if [ ! "$GOTIT" = "yes" ] ; then
68 echo "Downloading $PKGNAME1 package..."
69 wget -c $DLURL/$BIGTAR1
72 if test -e $TARPATH/$BIGTAR1
77 if [ ! "$GOTIT" = "yes" ] ; then
78 echo Testing the file to see if it is good.
79 export TEST=`$INSTPATH/md5sum $TARPATH/$BIGTAR1 | awk '{print $1}'`
88 echo Extracting the image file. This will take some time.
89 TARERR=`$TARCMD1 2>&1`
90 if [ "$?" = 0 ] ; then
91 rm -rf $TARPATH/$BIGTAR1
93 export MSG1=`printf "CONGRATULATIONS!\n\nAll has gone well!\n\nSuccess installing $PKGNAME1 package!"`
94 gxmessage -center -alignbuttons right -buttons GTK_STOCK_OK:0 -geometry 640x250 -title "SUCCESS!" "$MSG1"
96 export ERR1=`printf "ERROR! TAR FAILED!\nUnable to install $PKGNAME1\n$TARERR"`
97 gxmessage -center -alignbuttons right -buttons GTK_STOCK_OK:0 -geometry 640x380 -title "TAR ERROR" "$ERR1"
101 export ERR1=`printf "$PKGNAME1 package appears damaged.\nPress OK to try downloading again.\nCancel keeps the damaged file."`
102 gxmessage -center -alignbuttons right -buttons GTK_STOCK_OK:0,GTK_STOCK_CANCEL:1 -geometry 640x100 -title "DOWNLOAD ERROR" "$ERR1"
103 if [ "$?" = 1 ] ; then
111 # Stop if only getting one package