summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2008-02-29 14:27:15 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:31:06 +0100
commit037b3b3c1fc5a6079b011071b2bb6494249b00fb (patch)
treed6f129d66d4d4ec51e224567b1e3d2e37ecc9723 /scripts
parent137f616fb77851cf84c0c2b3f99d77f4337424c4 (diff)
downloadlive-boot-037b3b3c1fc5a6079b011071b2bb6494249b00fb.tar.gz
live-boot-037b3b3c1fc5a6079b011071b2bb6494249b00fb.zip
Adding hook parameter to execute custom scripts.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/live5
-rwxr-xr-xscripts/live-bottom/99hook39
2 files changed, 44 insertions, 0 deletions
diff --git a/scripts/live b/scripts/live
index 0280edd..ea770f4 100755
--- a/scripts/live
+++ b/scripts/live
@@ -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
index 0000000..0341026
--- /dev/null
+++ b/scripts/live-bottom/99hook
@@ -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