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/autorun.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/autorun.sh')
-rwxr-xr-x | nfs/autorun.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/nfs/autorun.sh b/nfs/autorun.sh new file mode 100755 index 0000000..4d6461a --- /dev/null +++ b/nfs/autorun.sh @@ -0,0 +1,30 @@ +#!/bin/busybox sh +read -t10 -p 'Press Enter or wait 10 sec...' # Let the user read machine_info and other usefull informations on console (or skip with Enter) +echo -e '\n\n\n\n\n' # Make some blank lines on console + +# Define some handy variables +imagedir=/mnt/nfs/images +scriptdir=/mnt/nfs/scripts/ +hostname=$(hostname) + +# Load helper functions +source $scriptdir/funcs.sh # Load some autorun.sh specific helper functions +source /etc/init.d/funcs # Reload init help 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 + source $scriptdir/image_deploy.sh + +else # Start capture script if all it needs is available + if scriptavailability_test image_capture_${hostname}.sh + then source $scriptdir/image_capture.sh + fi +fi + +# Display ending message then reboot +eficast_end |