-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstaller.bash
More file actions
80 lines (75 loc) · 2.33 KB
/
installer.bash
File metadata and controls
80 lines (75 loc) · 2.33 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
# Made By Luca https://github.com/Hyperscale1
# Discord _hyperscale
RED='\033[0;31m'
CYAN='\033[0;36m'
PURPLE='\033[0;35m'
NC='\033[0m' # No Color
echo -e "${RED}Starting Installer...${NC}"
echo -e "${RED}Made by Luca https://github.com/Hyperscale1${NC}"
sleep 5
echo -e "${PURPLE}Select a node version${NC}"
read nodev
echo -e "${PURPLE}Selected node version is $nodev.${NC} ${RED}Is this correct? (yes/no)${NC}"
read correct
if [ $correct = "yes" ]
then
echo -e "${PURPLE}Installing node version $nodev${NC}"
sleep 1
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
sleep 2
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
sleep 1
nvm install $nodev
sleep 1
nvm use $nodev
sleep 1
if [ $? -eq 0 ]; then
echo -e "${CYAN}Node version $nodev installed${NC}"
else
echo -e "${RED}Node version $nodev failed to install${NC}"
exit
fi
echo -e "${PURPLE}Installing NGINX${NC}"
sleep 5
sudo apt update -y
sudo apt install nginx -y
if [ $? -eq 0 ]; then
echo -e "${CYAN}NGINX has successfully installed${NC}"
else
echo -e "${RED}NGINX failed to install${NC}"
exit
fi
sleep 5
echo -e "${PURPLE}MYSQL is installing${NC}"
sleep 1
sudo apt install mysql-server -y
sleep 1
echo -e "${PURPLE}Input MYSQL Password (Remember this password. It can't easily be retreived)${NC}"
read mysqlpass
sleep 1
sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$mysqlpass';" -e "FLUSH PRIVILEGES;"
if [ $? -eq 0 ]; then
echo -e "${CYAN}MYSQL has successfully installed.${NC}"
else
echo -e "${RED}MYSQL failed to install${NC}"
exit
fi
sleep 1
echo -e "${PURPLE}Installing Certbot for NGINX${NC}"
sudo apt install certbot python3-certbot-nginx -y
if [ $? -eq 0 ]; then
echo -e "${CYAN}Certbot has successfully installed${NC}"
else
echo -e "${RED}Certbot failed to install${NC}"
exit
fi
echo -e "${CYAN}All services have been installed!${NC}"
exit
fi
if [ $correct = "no" ]
then
echo -e "${RED}Please restart the installer and select the correct node version.${NC}"
exit
fi