diff options
Diffstat (limited to 'core/scripts/setup-iso.sh')
-rw-r--r-- | core/scripts/setup-iso.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/core/scripts/setup-iso.sh b/core/scripts/setup-iso.sh new file mode 100644 index 0000000..93858d6 --- /dev/null +++ b/core/scripts/setup-iso.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +# Absolute path to this script, e.g. /home/user/bin/foo.sh +SCRIPT=$(readlink -f "$0") +# Absolute path this script is in, thus /home/user/bin +SCRIPTPATH=$(dirname "$SCRIPT") + +DIR=$(dirname "$SCRIPTPATH"); +DIR_LOCAL="$(dirname $(dirname ${DIR}))/local"; + +ISO_URL="https://serverop.de/crux/crux-3.2/iso/crux-3.2.iso" +ISO_FILE="${DIR_LOCAL}/crux-3.2.iso" + + +# First we define the function +ConfirmOrExit () +{ + while true + do + echo -n "Please confirm (y or n) :" + read CONFIRM + case $CONFIRM in + y|Y|YES|yes|Yes) break ;; + n|N|no|NO|No) + echo "Aborting - you entered $CONFIRM" + exit + ;; + *) echo "Please enter only y or n" + esac + done + echo "You entered $CONFIRM. Continuing ..." +} + +echo "1.1.1 Path/to crux-3.2.iso:" +echo $ISO_FILE +ConfirmOrExit + +#prepare_iso() { + + if [ -f $ISO_FILE ]; + then + echo "File $ISO_FILE exists." + else + echo "File $ISO_FILE does not exist." + cd $ISO_PATH && { curl -k -O $ISO_URL ; cd -; } + fi + +#} + |