Blame SOURCES/pxe-rsync-output.patch

2f081d
diff --git a/usr/share/rear/output/PXE/default/820_copy_to_net.sh b/usr/share/rear/output/PXE/default/820_copy_to_net.sh
2f081d
new file mode 100644
2f081d
index 00000000..dba1e526
2f081d
--- /dev/null
2f081d
+++ b/usr/share/rear/output/PXE/default/820_copy_to_net.sh
2f081d
@@ -0,0 +1,30 @@
2f081d
+
2f081d
+# 820_copy_to_net.sh
2f081d
+
2f081d
+# Check if we have a target location OUTPUT_URL
2f081d
+test "$OUTPUT_URL" || return 0
2f081d
+
2f081d
+local scheme=$( url_scheme $OUTPUT_URL )
2f081d
+local result_file=""
2f081d
+local path=""
2f081d
+
2f081d
+case "$scheme" in
2f081d
+    (nfs|cifs|usb|tape|file|davfs)
2f081d
+        # The ISO has already been transferred by NETFS.
2f081d
+        return 0
2f081d
+        ;;
2f081d
+    (fish|ftp|ftps|hftp|http|https|sftp)
2f081d
+        # output/default/950_copy_result_files.sh will transfer them
2f081d
+        return 0
2f081d
+        ;;
2f081d
+    (rsync)
2f081d
+        LogPrint "Transferring PXE files to $OUTPUT_URL"
2f081d
+        for result_file in "${RESULT_FILES[@]}" ; do
2f081d
+            LogPrint "Transferring file: $result_file"
2f081d
+            rsync -a $v "$result_file" "$OUTPUT_URL" || Error "Problem transferring '$result_file' to $OUTPUT_URL"
2f081d
+        done
2f081d
+        ;;
2f081d
+    (*) Error "Invalid scheme '$scheme' in '$OUTPUT_URL'."
2f081d
+        ;;
2f081d
+esac
2f081d
+