99hook: Download hook script from inside target filesystem
[live-boot-grml.git] / scripts / live-bottom / 99hook
1 #!/bin/sh
2
3 #set -e
4
5 # initramfs-tools header
6
7 PREREQ=""
8
9 prereqs()
10 {
11         echo "${PREREQ}"
12 }
13
14 case "${1}" in
15         prereqs)
16                 prereqs
17                 exit 0
18                 ;;
19 esac
20
21 # live-initramfs header
22
23 if [ -z "${HOOK}" ]
24 then
25         exit 0
26 fi
27
28 . /scripts/live-functions
29
30 log_begin_msg "Executing custom hook script..."
31
32 # live-initramfs script
33
34 cd /root
35 chroot /root wget "${HOOK}"
36
37 FILE="$(basename ${HOOK})"
38
39 chmod 0755 "${FILE}"
40 ./"${FILE}"
41 rm -f "${FILE}"
42
43 log_end_msg