diff options
Diffstat (limited to 'nfs/nfs-autorun.sh')
-rwxr-xr-x | nfs/nfs-autorun.sh | 23 |
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 |