From ba53f9d66a41a6ac58b5b6915b11c09d68bfa865 Mon Sep 17 00:00:00 2001 From: Derpman Date: Sun, 18 Aug 2024 22:58:20 -0400 Subject: [PATCH] Create start.sh --- start.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 start.sh diff --git a/start.sh b/start.sh new file mode 100644 index 00000000..54883fe8 --- /dev/null +++ b/start.sh @@ -0,0 +1,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}"