Adding hook parameter to execute custom scripts.
authorDaniel Baumann <daniel@debian.org>
Fri, 29 Feb 2008 13:27:15 +0000 (14:27 +0100)
committerDaniel Baumann <daniel@debian.org>
Wed, 9 Mar 2011 16:31:06 +0000 (17:31 +0100)
scripts/live
scripts/live-bottom/99hook [new file with mode: 0755]

index 0280edd..ea770f4 100755 (executable)
@@ -60,6 +60,11 @@ Arguments ()
                                 export FETCH
                                 ;;
 
+                       hook=*)
+                               HOOK="${ARGUMENT#hook=}"
+                               export HOOK
+                               ;;
+
                        hostname=*)
                                HOSTNAME="${ARGUMENT#hostname=}"
                                LIVECONF="changed"
diff --git a/scripts/live-bottom/99hook b/scripts/live-bottom/99hook
new file mode 100755 (executable)
index 0000000..0341026
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -z "${HOOK}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Executing custom hook script..."
+
+# live-initramfs script
+
+cd /root
+wget "${HOOK}"
+
+./$(basename ${HOOK})
+
+log_end_msg