#!/usr/bin/env bash set -e # Colors RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # No Color INSTALL_DIR="/opt/isocreator" BIN_LINK="/usr/local/bin/isocreator" CACHE_DIR="$HOME/.isocreator" echo -e "${BLUE}đŸ—‘ī¸ isocreator uninstaller${NC}" echo "" # Remove binary if [ -f "${INSTALL_DIR}/isocreator" ]; then echo -e "${BLUE}đŸ“Ļ Removing binary from ${INSTALL_DIR}...${NC}" rm -f "${INSTALL_DIR}/isocreator" # Remove directory if empty if [ -d "$INSTALL_DIR" ] && [ -z "$(ls -A $INSTALL_DIR)" ]; then rmdir "$INSTALL_DIR" fi echo -e "${GREEN}✅ Binary removed${NC}" else echo -e "${YELLOW}âš ī¸ Binary not found at ${INSTALL_DIR}${NC}" fi # Remove symlink if [ -L "$BIN_LINK" ]; then echo -e "${BLUE}🔗 Removing symlink ${BIN_LINK}...${NC}" rm -f "$BIN_LINK" echo -e "${GREEN}✅ Symlink removed${NC}" else echo -e "${YELLOW}âš ī¸ Symlink not found at ${BIN_LINK}${NC}" fi # Ask about cache if [ -d "$CACHE_DIR" ]; then echo "" echo -e "${YELLOW}Cache directory found: ${CACHE_DIR}${NC}" read -p "Do you want to remove cached ISOs? (y/N) " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then echo -e "${BLUE}đŸ—‘ī¸ Removing cache directory...${NC}" rm -rf "$CACHE_DIR" echo -e "${GREEN}✅ Cache removed${NC}" else echo -e "${BLUE}â„šī¸ Cache directory kept${NC}" fi fi echo "" echo -e "${GREEN}✅ isocreator uninstalled successfully!${NC}"