#usr/lib
usr/lib/libgcc_s.so
usr/lib/libgcc_s.so.1
+usr/local/bin/backupiso
usr/local/bin/connscheduler
usr/local/bin/dialctrl.pl
usr/local/bin/hddshutdown
GREEN_BROADCAST=192.168.180.255
ROOT_PASSWORD=ipfire
ADMIN_PASSWORD=ipfire
+RESTORE_FILE=
}
print CLIENTCONF "verb 3\r\n";
print CLIENTCONF "ns-cert-type server\r\n";
+ print CLIENTCONF "tls-remote $vpnsettings{ROOTCERT_HOSTNAME}\r\n";
close(CLIENTCONF);
$zip->addFile( "$tempdir/$clientovpn", $clientovpn) or die "Can't add file $clientovpn\n";
my $status = $zip->writeToFileNamed($zippathname);
int unattended = 0;
struct keyvalue *unattendedkv = initkeyvalues();
int hardyn = 0;
+ char restore_file[STRING_SIZE] = "";
setlocale (LC_ALL, "");
sethostname( SNAME , 10);
fprintf(flog, "unattended: Reading unattended.conf\n");
(void) readkeyvalues(unattendedkv, UNATTENDED_CONF);
+ findkey(unattendedkv, "RESTORE_FILE", restore_file);
}
/* Make the hdparms struct and print the contents.
goto EXIT;
}
+ /* Copy restore file from cdrom */
+ if (unattended && (strlen(restore_file) > 0)) {
+ fprintf(flog, "unattended: Copy restore file\n");
+ snprintf(commandstring, STRING_SIZE,
+ "cp /cdrom/%s /harddisk/var/ipfire/backup", restore_file);
+ }
+
mysystem("umount /cdrom");
snprintf(commandstring, STRING_SIZE, "eject /dev/%s", sourcedrive);
mysystem(commandstring);
char green_broadcast[STRING_SIZE];
char root_password[STRING_SIZE];
char admin_password[STRING_SIZE];
- char restore_file[STRING_SIZE];
+ char restore_file[STRING_SIZE] = "";
findkey(unattendedkv, "DOMAINNAME", domainname);
findkey(unattendedkv, "HOSTNAME", hostname);
}
/* restore backup */
- if (!strcmp(restore_file, "")) {
+ if (strlen(restore_file) > 0) {
fprintf(flog, "unattended: Restoring Backup\n");
snprintf(commandstring, STRING_SIZE,
- "cd /harddisk && /bin/tar -xvz --preserve -f /cdrom/%s", restore_file);
+ "cd /harddisk && /bin/tar -xvz --preserve -f /harddisk/var/ipfire/%s", restore_file);
if (mysystem(commandstring)) {
- errorbox("unattended: ERROR setting admin password");
- return 0;
+ errorbox("unattended: ERROR restoring backup");
}
}
--- /dev/null
+#!/bin/sh
+
+# FIXME: edit this lines before release
+#URL=http://download.ipfire.org/iso/
+#ISO=ipfire-2.3-beta4.i586-full.iso
+URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20080929-6uhr/
+ISO=ipfire-2.3-test.i586-full.iso
+
+if [ -z "$1" ]; then
+ echo usage: $0 backup-file
+ exit
+fi
+
+TS=$1
+
+mkdir -p /var/tmp/backupiso
+cd /var/tmp/backupiso
+
+echo "Fetching ${URL}${ISO}"
+wget --quiet -c ${URL}${ISO}
+echo "Fetching ${URL}md5sums.txt"
+wget --quiet -O md5sums.txt ${URL}md5sums.txt
+
+echo "Checking md5 of ${ISO}"
+cat md5sums.txt | grep iso | tr '\r' '\n' | md5sum --status -c
+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}
+fi
+
+echo "Remastering iso"
+mkdir -p backupiso.tmp.${TS}
+mount -o loop ${ISO} backupiso.tmp.${TS}
+cp -pr backupiso.tmp.${TS} backupiso.${TS}
+umount backupiso.tmp.${TS}
+rm -r backupiso.tmp.${TS}
+
+echo "RESTORE=${TS}.ipf" >> backupiso.${TS}/boot/unattended.conf
+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
+
+echo "Cleaning up"
+rm -rf backupiso.${TS}