summaryrefslogtreecommitdiff
path: root/nfs/scripts/image_capture.sh
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic.pouzenc@mines-albi.fr>2017-07-21 17:13:09 +0200
committerLudovic Pouzenc <ludovic.pouzenc@mines-albi.fr>2017-07-21 17:13:09 +0200
commite26f916388a1383dfcfc0b178550f84c8cde352f (patch)
treed768aff8e42a458c5083846ac88b53ff2376c917 /nfs/scripts/image_capture.sh
parentafb7ee8cc6232ceda7a5810b9d285ceff857b0b6 (diff)
downloadeficast-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.sh21
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
+