[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] live-initramfs: allow local file to be processed by 99hook



Hi,

pls find attached a small patch allowing the execution of a local file as hook script. The current implementation uses wget to retrieve the HOOK file, while the patch introduces the support for the "file://" prefix, in which case the hook script is simply copied from the specified path and then executed.

Best regards

Luigi
--- a/99hook	2009-08-26 11:13:03.000000000 +0200
+++ b/99hook	2009-10-22 17:50:02.000000000 +0200
@@ -32,7 +32,12 @@
 # live-initramfs script
 
 cd /root
-chroot /root wget "${HOOK}"
+if [ $(echo "${HOOK}" | grep file:\/\/) ]; then
+	LOCALFILE=$(echo $HOOK | sed "s/file\:\/\///")
+	cp $LOCALFILE /root
+else
+	chroot /root wget "${HOOK}"
+fi
 
 FILE="$(basename ${HOOK})"
 

Reply to: