From 22a6439f8db3ac76f871bcd0bf8e98b9ae82e8d4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 29 Feb 2008 14:27:15 +0100 Subject: [PATCH] Adding hook parameter to execute custom scripts. --- scripts/live | 5 +++++ scripts/live-bottom/99hook | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 scripts/live-bottom/99hook 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 -- 2.1.4