Blame SOURCES/pxe-rsync-output.patch

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