Skip to content

Commit 2f624ac

Browse files
committed
Add UltraCheese
1 parent d88c9cd commit 2f624ac

File tree

2 files changed

+145
-0
lines changed

2 files changed

+145
-0
lines changed
218 KB
Binary file not shown.
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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.1"
17+
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
18+
19+
20+
print_brake() {
21+
for ((n = 0; n < $1; n++)); do
22+
echo -n "#"
23+
done
24+
echo ""
25+
}
26+
27+
28+
hyperlink() {
29+
echo -e "\e]8;;${1}\a${1}\e]8;;\a"
30+
}
31+
32+
33+
#### Colors ####
34+
35+
GREEN="\e[0;92m"
36+
YELLOW="\033[1;33m"
37+
reset="\e[0m"
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+
dependencies() {
76+
echo
77+
print_brake 30
78+
echo -e "* ${GREEN}Installing dependencies...${reset}"
79+
print_brake 30
80+
echo
81+
case "$OS" in
82+
debian | ubuntu)
83+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && apt-get install -y unzip
84+
;;
85+
86+
centos)
87+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo yum install -y nodejs yarn && sudo yum install -y unzip
88+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo dnf install -y nodejs yarn && sudo dnf install -y unzip
89+
;;
90+
esac
91+
}
92+
93+
94+
#### Donwload Files ####
95+
print_brake 25
96+
echo -e "* ${GREEN}Downloading files...${reset}"
97+
print_brake 25
98+
download_files() {
99+
cd /var/www/pterodactyl
100+
mkdir -p tmp
101+
cd tmp
102+
curl -o UltraCheese.zip https://github.com/Ferks-FK/Pterodactyl-AutoThemes/tree/${SCRIPT_VERSION}/themes/version1.x/UltraCheese/UltraCheese.zip
103+
unzip UltraCheese.zip
104+
cd UltraCheese
105+
cp -R -- * /var/www/pterodactyl
106+
cd ..
107+
rm -R tmp
108+
}
109+
110+
#### Panel Production ####
111+
112+
production() {
113+
DIR=/var/www/pterodactyl
114+
115+
if [ -d "$DIR" ]; then
116+
echo
117+
print_brake 25
118+
echo -e "* ${GREEN}Producing panel...${reset}"
119+
print_brake 25
120+
npm i -g yarn
121+
cd /var/www/pterodactyl
122+
yarn install
123+
yarn add @emotion/react
124+
yarn build:production
125+
fi
126+
}
127+
128+
129+
bye() {
130+
print_brake 50
131+
echo
132+
echo -e "* ${GREEN}The theme ${YELLOW}Dracula${GREEN} was successfully installed.${reset}"
133+
echo -e "* ${GREEN}Thank you for using this script.${reset}"
134+
echo -e "* ${GREEN}Support group: $(hyperlink "$SUPPORT_LINK")${reset}"
135+
echo
136+
print_brake 50
137+
}
138+
139+
140+
#### Exec Script ####
141+
check_distro
142+
dependencies
143+
download_files
144+
production
145+
bye

0 commit comments

Comments
 (0)