]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
backupiso: serveral small improvements.
authorTimo Eissler <morlix@morlix.de>
Thu, 14 Feb 2013 21:08:30 +0000 (22:08 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 14 Feb 2013 21:08:30 +0000 (22:08 +0100)
fixes #10233

config/rootfiles/core/66/filelists/files
src/scripts/backupiso

index a7f3664400988cbadb7829275811f8f94c158f26..e139bb01ab07e6fc800c87dc64bc27a9eff6cad2 100644 (file)
@@ -38,6 +38,7 @@ srv/web/ipfire/cgi-bin/services.cgi
 srv/web/ipfire/cgi-bin/updatexlrator.cgi
 srv/web/ipfire/cgi-bin/vpnmain.cgi
 usr/bin/watch
+usr/local/bin/backupiso
 usr/local/bin/makegraphs
 usr/local/bin/readhash
 usr/local/bin/scanhd
index 6bea85578b80553fc3e7f8d6bf732bb4ddd0b681..ffbc54fc5d9d6041f670f9f530efc0913a810192 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/sh
 
-COREVER=`cat /opt/pakfire/db/core/mine`
+COREVER=$(cat /opt/pakfire/db/core/mine)
 # FIXME: edit this lines before release
-URL=http://download.ipfire.org/releases/ipfire-2.x/2.11-core$COREVER/
-ISO=ipfire-2.11.i586-full-core$COREVER.iso
+URL="http://download.ipfire.org/releases/ipfire-2.x/2.13-core$COREVER/"
+ISO="ipfire-2.13.i586-full-core$COREVER.iso"
 
-if [ -z "$1" ]; then 
+if [ -z $1 ]; then
        echo usage: $0 backup-file
        exit
 fi
@@ -17,20 +17,30 @@ cd /var/tmp/backupiso
 
 echo "Fetching ${URL}${ISO}"
 wget --quiet -c ${URL}${ISO}
-echo "Fetching ${URL}md5sums.txt"
+echo "Fetching ${URL}${ISO}.md5"
 wget --quiet -O ${ISO}.md5 ${URL}${ISO}.md5
 
 echo "Checking md5 of ${ISO}"
 md5sum --status -c ${ISO}.md5
-RETVAR="$?"
-if [ $RETVAR -eq 0 -o $RETVAR -eq 24 ]
-       then
-                echo "md5 is OK"
-       else
-                echo "md5 mismatch"
-               echo "Fetching again ${URL}${ISO}"
-               wget --quiet -O ${ISO} ${URL}${ISO}
+if [ $? -eq 0 -o $? -eq 24 ]
+then
+       echo "md5 is OK"
+else
+       echo "md5 mismatch"
+       echo "Fetching again ${URL}${ISO}"
+       wget --quiet -O ${ISO} ${URL}${ISO}
+       echo "Checking again md5 of ${ISO}"
+       md5sum --status -c ${ISO}.md5
+       if [ $? -eq 0 -o $? -eq 24 ]
+       then
+               echo "md5 is OK"
+       else
+               echo "md5 mismatch"
+               echo "aborting backup because md5 mismatch"
+               exit 1
+       fi
 fi
+rm ${ISO}.md5
 
 echo "Remastering iso"
 mkdir -p backupiso.tmp.${TS}
@@ -45,7 +55,7 @@ cp /var/ipfire/backup/${TS}.ipf backupiso.${TS}
 echo "Running mkisofs"
 mkisofs -J -r -V "ipfire backup ${TS}" \
             -b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
-            -c boot/isolinux/boot.catalog backupiso.${TS} > `basename ${ISO} .iso`-${TS}.iso
+            -c boot/isolinux/boot.catalog backupiso.${TS} > $(basename ${ISO} .iso)-${TS}.iso
 
 echo "Cleaning up"
 rm -rf backupiso.${TS}