mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01:00
feat: uninstall script
This commit is contained in:
parent
876475e25b
commit
4ab36f331a
|
|
@ -78,4 +78,13 @@ sudo bash /opt/project-nomad/start_nomad.sh
|
|||
###### Update Script - Attempts to pull the latest images for the Command Center and its dependencies (i.e. mysql) and recreate the containers. Note: this *only* updates the Command Center containers. It does not update the installable application containers - that should be done through the Command Center UI
|
||||
```bash
|
||||
sudo bash /opt/project-nomad/update_nomad.sh
|
||||
```
|
||||
|
||||
###### Uninstall Script - Need to start fresh? Use the uninstall script to make your life easy. Note: this cannot be undone!
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/Crosstalk-Solutions/project-nomad/refs/heads/master/install/uninstall_nomad.sh -o uninstall_nomad.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo bash uninstall_nomad.sh
|
||||
```
|
||||
89
install/uninstall_nomad.sh
Normal file
89
install/uninstall_nomad.sh
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Project N.O.M.A.D. Uninstall Script
|
||||
|
||||
###################################################################################################################################################################################################
|
||||
|
||||
# Script | Project N.O.M.A.D. Uninstall Script
|
||||
# Version | 1.0.0
|
||||
# Author | Crosstalk Solutions, LLC
|
||||
# Website | https://crosstalksolutions.com
|
||||
|
||||
###################################################################################################################################################################################################
|
||||
# #
|
||||
# Constants & Variables #
|
||||
# #
|
||||
###################################################################################################################################################################################################
|
||||
|
||||
NOMAD_DIR="/opt/project-nomad"
|
||||
MANAGEMENT_COMPOSE_FILE="${NOMAD_DIR}/docker-compose-management.yaml"
|
||||
|
||||
###################################################################################################################################################################################################
|
||||
# #
|
||||
# Functions #
|
||||
# #
|
||||
###################################################################################################################################################################################################
|
||||
|
||||
check_current_directory(){
|
||||
if [ "$(pwd)" == "${NOMAD_DIR}" ]; then
|
||||
echo "Please run this script from a directory other than ${NOMAD_DIR}."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_management_compose_file_exists(){
|
||||
if [ ! -f "${MANAGEMENT_COMPOSE_FILE}" ]; then
|
||||
echo "Unable to find the management Docker Compose file at ${MANAGEMENT_COMPOSE_FILE}. There may be a problem with your Project N.O.M.A.D. installation."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_uninstall_confirmation(){
|
||||
read -p "This script will remove ALL Project N.O.M.A.D. files and containers. THIS CANNOT BE UNDONE. Are you sure you want to continue? (y/n): " choice
|
||||
case "$choice" in
|
||||
y|Y )
|
||||
echo -e "User chose to continue with the uninstallation."
|
||||
;;
|
||||
n|N )
|
||||
echo -e "User chose not to continue with the uninstallation."
|
||||
exit 0
|
||||
;;
|
||||
* )
|
||||
echo "Invalid Response"
|
||||
echo "User chose not to continue with the uninstallation."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
ensure_docker_installed() {
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "Unable to find Docker. There may be a problem with your Docker installation."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
uninstall_nomad() {
|
||||
echo "Stopping and removing Project N.O.M.A.D. containers..."
|
||||
docker compose -f "${MANAGEMENT_COMPOSE_FILE}" down
|
||||
|
||||
echo "Allowing some time for containers to stop..."
|
||||
sleep 15
|
||||
echo "Containers should be stopped now."
|
||||
|
||||
echo "Removing Project N.O.M.A.D. files..."
|
||||
rm -rf "${NOMAD_DIR}"
|
||||
|
||||
echo "Project N.O.M.A.D. has been uninstalled. We hope to see you again soon!"
|
||||
}
|
||||
|
||||
###################################################################################################################################################################################################
|
||||
# #
|
||||
# Main #
|
||||
# #
|
||||
###################################################################################################################################################################################################
|
||||
check_current_directory
|
||||
ensure_management_compose_file_exists
|
||||
ensure_docker_installed
|
||||
get_uninstall_confirmation
|
||||
uninstall_nomad
|
||||
Loading…
Reference in New Issue
Block a user