Allow continue from failed profile

This commit is contained in:
2023-01-13 10:59:41 -05:00
parent 41900c4e02
commit 29ea95db65

View File

@@ -337,7 +337,8 @@ getImageBuilder() {
declare dl_tool declare dl_tool
if [[ -f "$IB_ARCHIVE" ]]; then if [[ -f "$IB_ARCHIVE" ]]; then
if askOk "Redownload ImageBuilder archive?"; then echo "Image Builder $IB_ARCHIVE exists"
if askOk "Redownload Image Builder archive?"; then
rm -f "$IB_ARCHIVE" rm -f "$IB_ARCHIVE"
else else
return 0 return 0
@@ -349,21 +350,21 @@ getImageBuilder() {
elif hash curl &>/dev/null; then elif hash curl &>/dev/null; then
dl_tool="curl" dl_tool="curl"
else else
echo "Downloading the ImageBuilder requires axel or curl!" echo "Downloading the Image Builder requires axel or curl!"
return 1 return 1
fi fi
echo "Downloading imagebuilder archive using $dl_tool" echo "Downloading Image Builder archive using $dl_tool"
debug "$dl_tool -o $IB_ARCHIVE $IB_URL" debug "$dl_tool -o $IB_ARCHIVE $IB_URL"
if ! "$dl_tool" -o "$IB_ARCHIVE" "$IB_URL"; then if ! "$dl_tool" -o "$IB_ARCHIVE" "$IB_URL"; then
echo "Could not download imagebuilder archive" echo "Could not download Image Builder archive"
exit 1 return 1
fi fi
if [[ ! -f "$IB_ARCHIVE" ]]; then if [[ ! -f "$IB_ARCHIVE" ]]; then
echo "Archive missing" echo "Archive missing"
exit 1 return 1
fi fi
@@ -376,12 +377,12 @@ getImageBuilder() {
# fi # fi
echo "Extracting image archive" echo "Extracting Image Builder archive"
[[ ! -d "$BUILDDIR" ]] && mkdir -p "$BUILDDIR" [[ ! -d "$BUILDDIR" ]] && mkdir -p "$BUILDDIR"
debug "tar -xf $IB_ARCHIVE -C $BUILDDIR --strip-components 1" debug "tar -xf $IB_ARCHIVE -C $BUILDDIR --strip-components 1"
if ! tar -xf "$IB_ARCHIVE" -C "$BUILDDIR" --strip-components 1; then if ! tar -xf "$IB_ARCHIVE" -C "$BUILDDIR" --strip-components 1; then
echo "Extraction failed" echo "Extraction failed"
exit 1 return 1
fi fi
} }
@@ -679,12 +680,9 @@ main() {
(( FROM_SOURCE )) && fromSource (( FROM_SOURCE )) && fromSource
getImageBuilder getImageBuilder &&
addRepos &&
addRepos #copyFiles &&
#copyFiles
[[ -v SSH_BACKUP_PATH ]] && sshBackup [[ -v SSH_BACKUP_PATH ]] && sshBackup
if makeImage; then if makeImage; then
[[ -v SSH_UPGRADE_PATH ]] && sshUpgrade [[ -v SSH_UPGRADE_PATH ]] && sshUpgrade