-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
start.sh
59 lines (47 loc) · 1.77 KB
/
start.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
57
58
59
#!/bin/sh
print_bold_with_outline() {
local msg="$1"
local length=${#msg}
local border=""
for i in $(seq 1 $((length + 4))); do
border="${border}#"
done
echo -e "\e[1m\e[44m$border\e[0m"
echo -e "\e[1m\e[44m# $msg #\e[0m
echo -e "\e[1m\e[44m$border\e[0m"
}
RED="\e[1;31m"
GREEN="\e[1;32m"
YELLOW="\e[1;33m"
BLUE="\e[1;34m"
RESET="\e[0m"
print_bold_with_outline "Welcome to Doge V4, user!"
if ! command -v git > /dev/null; then
echo -e "${RED}[Error] Git is not installed. Please install Git and try again.${RESET}"
exit 1
fi
echo -e "${BLUE}[1/4] Cloning Doge Unblocker repository...${RESET}"
if git clone https://github.com/DogeNetwork/v4 > /dev/null 2>&1; then
echo -e "${GREEN}[Success] Repository cloned successfully.${RESET}"
else
echo -e "${RED}[Error] Failed to clone repository. Please check your network connection, or see if the v4 folder already exists.${RESET}"
exit 1
fi
cd v4 || { echo -e "${RED}[Error] Failed to enter the project directory.${RESET}"; exit 1; }
echo -e "${BLUE}[2/4] Installing dependencies (this may take a moment)...${RESET}"
if npm install --progress=false > /dev/null 2>&1; then
echo -e "${GREEN}[Success] Dependencies installed successfully.${RESET}"
else
echo -e "${RED}[Error] Failed to install dependencies. Please check for npm errors.${RESET}"
exit 1
fi
echo -e "${BLUE}[3/4] Starting Doge Unblocker...${RESET}"
npm start
if [ $? -eq 0 ]; then
echo -e "${GREEN}[Success] Doge Unblocker started successfully.${RESET}"
echo -e "${YELLOW}[Info] You can access Doge V4 via localhost.${RESET}"
else
echo -e "${RED}[Error] Failed to start Doge Unblocker. Please check the application logs for details.${RESET}"
exit 1
fi
echo -e "${BLUE}[4/4] Installation Complete.${RESET}"