20-propagator-rescue-hash-syslinux 393 Bytes
Newer Older
1 2 3 4 5 6 7
#!/bin/sh
# postprocess isolinux configuration
# to add rescue image hash, if any
# (for propagator in forensic mode)

cd "$WORKDIR"

8 9
[ -d "syslinux" ] || exit 0

10 11 12 13 14 15 16
grep -qs "@rescue_hash@" syslinux/*.cfg || exit 0

find -maxdepth 1 -type f -name rescue \
| while read image; do
	rescue_hash="$(sha256sum -b "$image" | cut -f1 -d' ')"
	sed -i "s,@rescue_hash@,$rescue_hash," syslinux/*.cfg
done