#!/bin/bash # # Uninstall Voice Assistant # # AI Now Inc - Del Mar Demo Unit # set -e echo "==========================================" echo " Uninstall Voice Assistant" echo "==========================================" echo "" # Confirm uninstall read -p "Are you sure you want to uninstall? (y/N): " confirm if [[ ! $confirm =~ ^[Yy]$ ]]; then echo "Uninstall cancelled." exit 0 fi # Stop service echo "Stopping service..." sudo systemctl stop voice-assistant 2>/dev/null || true sudo systemctl disable voice-assistant 2>/dev/null || true sudo rm -f /etc/systemd/system/voice-assistant.service # Remove installation directory INSTALL_DIR="/home/pi/voice-assistant" if [ -d "$INSTALL_DIR" ]; then echo "Removing $INSTALL_DIR..." sudo rm -rf "$INSTALL_DIR" fi # Remove music directory (optional) MUSIC_DIR="/home/pi/Music" if [ -d "$MUSIC_DIR" ]; then read -p "Remove music directory ($MUSIC_DIR)? (y/N): " remove_music if [[ $remove_music =~ ^[Yy]$ ]]; then sudo rm -rf "$MUSIC_DIR" fi fi # Clean up systemd sudo systemctl daemon-reload echo "" echo "Uninstall complete!" echo "" echo "To reinstall, run:" echo " cd /path/to/voice-assistant" echo " sudo ./install.sh" echo ""