summaryrefslogtreecommitdiff
path: root/nfs/nfs-autorun.sh
blob: 3a0df2f8dce97729d53eaba56efa7f19e7e71adf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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
	message deploy ; pause10s; sfx_starting
	source $scriptdir/image_deploy.sh

else	scriptavailability_test image_capture_${hostname}.sh || exit 3
	# Start capture script if all it needs is available
	message capture ; pause10s; sfx_starting
	source $scriptdir/image_capture.sh
fi