diff options
author | Ludovic Pouzenc <ludovic.pouzenc@mines-albi.fr> | 2017-07-21 17:13:09 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic.pouzenc@mines-albi.fr> | 2017-07-21 17:13:09 +0200 |
commit | e26f916388a1383dfcfc0b178550f84c8cde352f (patch) | |
tree | d768aff8e42a458c5083846ac88b53ff2376c917 /nfs/scripts/image_capture.sh | |
parent | afb7ee8cc6232ceda7a5810b9d285ceff857b0b6 (diff) | |
download | eficast-e26f916388a1383dfcfc0b178550f84c8cde352f.tar.gz eficast-e26f916388a1383dfcfc0b178550f84c8cde352f.tar.bz2 eficast-e26f916388a1383dfcfc0b178550f84c8cde352f.zip |
Add post-boot scripting (work in progress)
Diffstat (limited to 'nfs/scripts/image_capture.sh')
-rw-r--r-- | nfs/scripts/image_capture.sh | 21 |
1 files changed, 21 insertions, 0 deletions
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_<hostname>.sh) +source $scriptdir/image_capture_${hostname}.sh + +date >>logs/date.log + |