-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrave_automatic_setuper.sh
More file actions
106 lines (79 loc) · 2.92 KB
/
crave_automatic_setuper.sh
File metadata and controls
106 lines (79 loc) · 2.92 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
clear
GREEN="\033[1;32m"
RED="\033[1;31m"
BLUE="\033[1;34m"
YELLOW="\033[1;33m"
NC="\033[0m"
print_step() {
echo -e "${YELLOW}[➤] $1${NC}"
}
success_msg() {
echo -e "${GREEN}[✔] $1${NC}"
}
error_exit() {
echo -e "${RED}[✖] Error: $1${NC}"
exit 1
}
echo -e "${BLUE}"
echo "===================================================="
echo " 🔧 Crave Setuper - Ubuntu via Termux "
echo "===================================================="
echo -e "${NC}"
ARCH=$(uname -m)
if [ "$ARCH" = "aarch64" ]; then
echo -e "${BLUE}[🔍] Detected Architecture: ${GREEN}arm64 (aarch64) — supported ✅${NC}"
else
echo -e "${RED}[✖] Detected Architecture: $ARCH — unsupported ❌${NC}"
echo -e "${RED}[⚠] This script supports only ARM64 (aarch64) devices.${NC}"
exit 1
fi
print_step "Installing proot-distro..."
pkg install -y proot-distro > /dev/null 2>&1 || error_exit "Failed to install proot-distro"
success_msg "proot-distro installed."
if proot-distro list | grep -q "ubuntu"; then
echo -e "${YELLOW}[⚠] Existing Ubuntu container detected. Removing...${NC}"
proot-distro remove ubuntu > /dev/null 2>&1 || {
echo -e "${RED}[✖] Failed to remove existing Ubuntu container.${NC}"
exit 1
}
echo -e "${GREEN}[✔] Old Ubuntu container removed.${NC}"
fi
print_step "Installing Ubuntu container (this may take some time)..."
proot-distro install ubuntu > /dev/null 2>&1 || error_exit "Failed to install Ubuntu"
success_msg "Ubuntu container installed."
print_step "Setting up Crave inside Ubuntu..."
proot-distro login ubuntu < /dev/null 2>/dev/null << EOF
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
RED="\033[1;31m"
BLUE="\033[1;34m"
NC="\033[0m"
echo -e "\${BLUE}[📦] Updating package list...\${NC}"
apt-get update > /dev/null 2>&1
echo -e "\${YELLOW}[➤] Installing dependencies (ssh, rsync, wget, curl)...\${NC}"
apt-get install -y ssh rsync wget curl > /dev/null 2>&1 || {
echo -e "\${RED}[✖] Failed to install dependencies.\${NC}"
exit 1
}
echo -e "\${GREEN}[✔] Dependencies installed.\${NC}"
echo -e "\${YELLOW}[➤] Downloading Crave with progress...\${NC}"
curl -# https://raw.githubusercontent.com/accupara/crave/refs/heads/master/get_crave.sh | bash -s -- > /dev/null 2>&1 || {
echo -e "\${RED}[✖] Failed to download Crave.\${NC}"
exit 1
}
chmod +x crave && mv crave /usr/local/bin > /dev/null 2>&1 || {
echo -e "\${RED}[✖] Failed to move Crave to /usr/local/bin.\${NC}"
exit 1
}
echo -e "\${GREEN}[✔] Crave installed successfully inside Ubuntu.\${NC}"
EOF
echo -e "${GREEN}"
echo "===================================================="
echo " ✅ Crave is now installed inside your Ubuntu container!"
echo " 🔍 To use Crave:"
echo " → Run: proot-distro login ubuntu"
echo " → Then: Download crave.conf file"
echo " → Then: type crave -n devspace and enter"
echo "===================================================="
echo -e "${NC}"