From e26f916388a1383dfcfc0b178550f84c8cde352f Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Fri, 21 Jul 2017 17:13:09 +0200 Subject: Add post-boot scripting (work in progress) --- nfs/scripts/image_capture.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 nfs/scripts/image_capture.sh (limited to 'nfs/scripts/image_capture.sh') diff --git a/nfs/scripts/image_capture.sh b/nfs/scripts/image_capture.sh new file mode 100644 index 0000000..53c75ad --- /dev/null +++ b/nfs/scripts/image_capture.sh @@ -0,0 +1,21 @@ +#!/bin/busybox sh +# Should only started from autorun.sh, it defines some helper functions and variables) + +# Prepare capture +year=$(date +%Y) +monthday=$(date +%m-%d) +outdir="$imagedir/$year/$hostname/$monthday" + +if [ -d "$outdir" ] +then rm -r "$outdir" +fi +mkdir -p "$outdir" +cd "$outdir" +mkdir logs +date >logs/date.log + +# Start the capture using the customized script (image_capture_.sh) +source $scriptdir/image_capture_${hostname}.sh + +date >>logs/date.log + -- cgit v1.2.3