-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuninstall.sh
executable file
·56 lines (46 loc) · 2.03 KB
/
uninstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Define colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
RESET='\033[0m'
# Confirmation prompt
echo -e "${YELLOW}Are you sure you want to uninstall RKLLama? This action will delete all associated files.${RESET}"
read -p "Type 'y' to continue, 'n' to cancel: " confirmation
if [[ "$confirmation" != "y" && "$confirmation" != "Y" ]]; then
echo -e "${RED}Uninstallation canceled.${RESET}"
exit 1
fi
# Ask if the user wants to back up the models before uninstallation
echo -e "${YELLOW}Do you want to back up the models?${RESET}"
read -p "Type 'y' to continue, 'n' to cancel: " confirmation_models
if [[ "$confirmation_models" == "y" || "$confirmation_models" == "Y" ]]; then
# Back up the models
echo -e "${GREEN}The models will be saved to /home/$(whoami)/Desktop/rkllm_models.${RESET}"
# Create the directory if needed
mkdir -p "/home/$(whoami)/Desktop/rkllm_models"
cp ~/RKLLAMA/models/*.rkllm "/home/$(whoami)/Desktop/rkllm_models"
echo -e "${GREEN}Models have been successfully backed up.${RESET}"
fi # <-- This was missing in your original script
# Start uninstallation message
echo -e "${CYAN}Starting uninstallation...${RESET}"
# Check if the RKLLAMA directory exists
if [ -d "$HOME/RKLLAMA" ]; then
echo -e "${YELLOW}Deleting the ~/RKLLAMA directory...${RESET}"
rm -rf ~/RKLLAMA/
echo -e "${GREEN}~/RKLLAMA directory deleted successfully.${RESET}"
else
echo -e "${RED}The ~/RKLLAMA directory does not exist, no deletion performed.${RESET}"
fi
# Check if the rkllama executable exists in /usr/local/bin/
if [ -f "/usr/local/bin/rkllama" ]; then
echo -e "${YELLOW}Deleting the /usr/local/bin/rkllama executable...${RESET}"
sudo rm /usr/local/bin/rkllama
echo -e "${GREEN}/usr/local/bin/rkllama executable deleted successfully.${RESET}"
else
echo -e "${RED}/usr/local/bin/rkllama executable does not exist, no deletion performed.${RESET}"
fi
# End of uninstallation message
echo -e "${GREEN}Uninstallation completed successfully.${RESET}"