]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/scripts/backupiso
7 echo "Your arch is $arch"
11 echo "Your arch is $arch"
14 echo "Arch is not supported"
19 COREVER
=$
(cat /opt
/pakfire
/db
/core
/mine
)
20 # FIXME: edit this lines before release
21 URL
="http://download.ipfire.org/releases/ipfire-2.x/2.19-core$COREVER/"
22 ISO
="ipfire-2.19.$arch-full-core$COREVER.iso"
25 echo usage
: $0 backup-file
31 mkdir
-p /var
/tmp
/backupiso
36 echo "Fetching ${URL}${ISO}"
37 wget
--quiet -c ${URL}${ISO}
40 echo "Fetching ${URL}${ISO}.md5"
41 wget
--quiet -O ${ISO}.md5 ${URL}${ISO}.md5
43 echo "Checking md5 of ${ISO}"
44 md5sum --status -c ${ISO}.md5
45 if [ $?
-eq 0 ] ||
[ $?
-eq 24 ]
50 echo "Fetching again ${URL}${ISO}"
51 wget
--quiet -O ${ISO} ${URL}${ISO}
52 echo "Checking again md5 of ${ISO}"
53 md5sum --status -c ${ISO}.md5
54 if [ $?
-eq 0 ] ||
[ $?
-eq 24 ]
59 echo "aborting backup because md5 mismatch"
65 echo "Remastering iso"
66 mkdir
-p backupiso.tmp.
${TS}
67 mount
-o loop
${ISO} backupiso.tmp.
${TS}
68 cp -pr backupiso.tmp.
${TS} backupiso.
${TS}
69 umount backupiso.tmp.
${TS}
70 rm -r backupiso.tmp.
${TS}
72 # Copy backup file to disk
73 cp "/var/ipfire/backup/${TS}.ipf" "backupiso.${TS}/backup.ipf"
75 echo "Running mkisofs"
76 mkisofs
-J -r -V "ipfire backup ${TS}" \
77 -b boot
/isolinux
/isolinux.bin
-no-emul-boot -boot-load-size 4 -boot-info-table \
78 -c boot
/isolinux
/boot.catalog backupiso.
${TS} > $(basename ${ISO} .iso)-${TS}.iso
79 isohybrid $
(basename ${ISO} .iso
)-${TS}.iso
82 rm -rf backupiso.
${TS}