mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-06-07 15:41:40 -04:00
Add confirmation prompt before proceeding with
uninstallation
This commit is contained in:
@@ -6,6 +6,15 @@ if [[ $EUID -ne 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Function to confirm with the user before proceeding
|
||||
confirm_action() {
|
||||
read -r -p "$1 Are you sure you want to proceed? (y/N): " response
|
||||
if [[ ! "$response" =~ ^[Yy]$ ]]; then
|
||||
echo "Uninstallation canceled."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop and remove the Dockge containers
|
||||
if command -v docker &> /dev/null; then
|
||||
# Using Docker CE
|
||||
@@ -20,6 +29,9 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Confirm with the user before removing the Dockge directories
|
||||
confirm_action "Removing Dockge directories..."
|
||||
|
||||
# Remove the Dockge directories
|
||||
echo "Removing Dockge directories..."
|
||||
rm -rf /opt/stacks /opt/dockge
|
||||
|
||||
Reference in New Issue
Block a user