summaryrefslogtreecommitdiff
path: root/nfs/nfs-autorun.sh
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2017-10-22 13:31:10 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2017-10-22 13:31:10 +0200
commit8142ffde3037976e152711f902ad9622aa1b7cba (patch)
tree1a113379f90812b13acc411bb1280e13b00a217a /nfs/nfs-autorun.sh
parentae649a17227f3ed2615f3d8eddc7ae19ccfaa45b (diff)
downloadeficast-8142ffde3037976e152711f902ad9622aa1b7cba.tar.gz
eficast-8142ffde3037976e152711f902ad9622aa1b7cba.tar.bz2
eficast-8142ffde3037976e152711f902ad9622aa1b7cba.zip
hours of polishing tmux, script sequences, hinting. ^C abort in tmux is broken.
Diffstat (limited to 'nfs/nfs-autorun.sh')
-rwxr-xr-xnfs/nfs-autorun.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/nfs/nfs-autorun.sh b/nfs/nfs-autorun.sh
new file mode 100755
index 0000000..b2be8b2
--- /dev/null
+++ b/nfs/nfs-autorun.sh
@@ -0,0 +1,23 @@
+#!/bin/busybox sh
+
+# Define some handy variables
+imagedir=/mnt/nfs/images
+scriptdir=/mnt/nfs/scripts/
+hostname=$(hostname)
+
+# Load helper functions
+source $scriptdir/funcs.sh # Load some nfs-autorun.sh specific helper functions
+
+# Check all prerequisites and exit if it fail
+hostname_test || exit 1
+firstdisk_test || exit 2
+
+# Run the main action script
+if nfswrite_test
+then # Start deploy script after letting a chance to cancel it
+ pause10s ; source $scriptdir/image_deploy.sh
+
+else scriptavailability_test image_capture_${hostname}.sh || exit 3
+ # Start capture script if all it needs is available
+ pause10s ; source $scriptdir/image_capture.sh
+fi