Skip to content

Commit

Permalink
Update OS-Reqs.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
NOXCIS committed Dec 14, 2023
1 parent 5d26a85 commit ef56b5f
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions Core-Installer-Functions/OS-Reqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,34 @@ create_swap() {


}
MAX_ATTEMPTS=3 # You can adjust the maximum number of attempts as needed

install_requirements() {
run_os_update &&
install_prerequisites &&
install_docker &&
create_swap &&
cat <<EOF >"preqsinstalled.txt"
!!!!!!
attempts=1

while [ $attempts -le $MAX_ATTEMPTS ]; do
echo "Attempt $attempts of $MAX_ATTEMPTS"

# Attempt the installation
run_os_update &&
install_prerequisites &&
install_docker &&
create_swap &&
cat <<EOF >"preqsinstalled.txt"
!!!!!!
EOF

# Check if the installation was successful
if [ $? -eq 0 ]; then
echo "Installation successful."
break # Exit the loop if successful
else
echo "Installation failed. Retrying..."
((attempts++))
fi
done

if [ $attempts -gt $MAX_ATTEMPTS ]; then
echo "Max attempts reached. Installation failed."
fi
}

0 comments on commit ef56b5f

Please sign in to comment.