Skip to content

Commit 606a39c

Browse files
authored
Add files via upload
1 parent 599f960 commit 606a39c

File tree

1 file changed

+143
-0
lines changed

1 file changed

+143
-0
lines changed

themes/version1.x/Default/build.sh

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

0 commit comments

Comments
 (0)