Skip to content

Commit 093c8eb

Browse files
authored
Update build.sh
1 parent 87a1e87 commit 093c8eb

File tree

1 file changed

+133
-1
lines changed

1 file changed

+133
-1
lines changed

themes/version1.x/Dracula/build.sh

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,133 @@
1-
1
1+
#!/bin/bash
2+
3+
set -e
4+
5+
########################################################
6+
#
7+
# Pterodactyl-AutoThemes Installation
8+
#
9+
# Created and maintained by Ferks-FK
10+
#
11+
# Protected by GPL 3.0 License
12+
#
13+
########################################################
14+
15+
#### Variables ####
16+
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
17+
18+
19+
print_brake() {
20+
for ((n = 0; n < $1; n++)); do
21+
echo -n "#"
22+
done
23+
echo ""
24+
}
25+
26+
27+
hyperlink() {
28+
echo -e "\e]8;;${1}\a${1}\e]8;;\a"
29+
}
30+
31+
32+
#### Colors ####
33+
34+
GREEN="\e[0;92m"
35+
YELLOW="\033[1;33m"
36+
reset="\e[0m"
37+
red='\033[0;31m'
38+
39+
40+
#### OS check ####
41+
42+
check_distro() {
43+
if [ -f /etc/os-release ]; then
44+
. /etc/os-release
45+
OS=$(echo "$ID")
46+
OS_VER=$VERSION_ID
47+
elif type lsb_release >/dev/null 2>&1; then
48+
OS=$(lsb_release -si)
49+
OS_VER=$(lsb_release -sr)
50+
elif [ -f /etc/lsb-release ]; then
51+
. /etc/lsb-release
52+
OS=$(echo "$DISTRIB_ID")
53+
OS_VER=$DISTRIB_RELEASE
54+
elif [ -f /etc/debian_version ]; then
55+
OS="debian"
56+
OS_VER=$(cat /etc/debian_version)
57+
elif [ -f /etc/SuSe-release ]; then
58+
OS="SuSE"
59+
OS_VER="?"
60+
elif [ -f /etc/redhat-release ]; then
61+
OS="Red Hat/CentOS"
62+
OS_VER="?"
63+
else
64+
OS=$(uname -s)
65+
OS_VER=$(uname -r)
66+
fi
67+
68+
OS=$(echo "$OS")
69+
OS_VER_MAJOR=$(echo "$OS_VER" | cut -d. -f1)
70+
}
71+
72+
73+
#### Install Dependencies ####
74+
75+
case "$OS" in
76+
debian | ubuntu)
77+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs
78+
;;
79+
80+
centos)
81+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo yum install -y nodejs yarn
82+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo dnf install -y nodejs yarn
83+
;;
84+
esac
85+
86+
87+
#### Donwload Files ####
88+
download_files() {
89+
cd /var/www/pterodactyl/resources/scripts
90+
curl -o user.css https://github.com/Ferks-FK/Pterodactyl-AutoThemes/blob/main/themes/version1.x/Dracula/user.css
91+
rm -R index.tsx
92+
curl -o index.tsx https://github.com/Ferks-FK/Pterodactyl-AutoThemes/blob/main/themes/version1.x/Dracula/index.tsx
93+
cd
94+
cd /var/www/pterodactyl/resources/views/layouts
95+
rm -R admin.blade.php
96+
curl -o admin.blade.php https://github.com/Ferks-FK/Pterodactyl-AutoThemes/blob/main/themes/version1.x/Dracula/admin.blade.php
97+
}
98+
99+
#### Panel Production ####
100+
101+
production() {
102+
DIR=/var/www/pterodactyl
103+
104+
if [ -d "$DIR" ]; then
105+
echo
106+
echo "**********************"
107+
echo "* Producing panel... *"
108+
echo "**********************"
109+
echo
110+
npm i -g yarn
111+
cd /var/www/pterodactyl
112+
yarn install
113+
yarn add @emotion/react
114+
yarn build:production
115+
fi
116+
}
117+
118+
119+
bye() {
120+
print_brake 25
121+
echo
122+
echo -e "* ${GREEN}The theme ${YELLOW}Dracula${GREEN} was successfully installed.${reset}"
123+
echo -e "* ${GREEN}Thank you for using this script.${reset}"
124+
echo -e "* ${GREEN}Support group: $(hyperlink "$SUPPORT_LINK")"
125+
echo
126+
}
127+
128+
129+
#### Exec Script ####
130+
download_files
131+
production
132+
bye
133+

0 commit comments

Comments
 (0)