diff --git a/prepare-boot-tools.sh b/prepare-boot-tools.sh index 9092c8f..f4ce00c 100755 --- a/prepare-boot-tools.sh +++ b/prepare-boot-tools.sh @@ -104,6 +104,28 @@ if [ -n "$BLANCCO_ISO" ] && [ -f "$BLANCCO_ISO" ]; then mkdir -p "$OUT_DIR/blancco/arch/x86_64" cp "$TMPDIR/arch/x86_64/airootfs.sfs" "$OUT_DIR/blancco/arch/x86_64/" echo " Extracted Blancco boot files." + + # Patch config.img to auto-save reports to PXE server Samba share + if [ -f "$OUT_DIR/blancco/config.img" ]; then + echo " Patching config.img for network report storage..." + CFGTMP=$(mktemp -d) + cd "$CFGTMP" + cpio -id < "$OUT_DIR/blancco/config.img" 2>/dev/null + + if [ -f "$CFGTMP/preferences.xml" ]; then + # Set network share to PXE server's blancco-reports Samba share + sed -i 's||10.9.100.1|' "$CFGTMP/preferences.xml" + sed -i 's||blancco-reports|' "$CFGTMP/preferences.xml" + # Enable auto-backup of reports to the network share + sed -i 's|false|true|' "$CFGTMP/preferences.xml" + + # Repack config.img + ls -1 | cpio -o -H newc > "$OUT_DIR/blancco/config.img" 2>/dev/null + echo " Reports will auto-save to \\\\10.9.100.1\\blancco-reports" + fi + cd "$SCRIPT_DIR" + rm -rf "$CFGTMP" + fi else echo " Could not extract boot files from ISO." fi