Skip to content

Commit 5da068c

Browse files
committed
Update
1 parent 1eaf51b commit 5da068c

File tree

6 files changed

+189
-188
lines changed

6 files changed

+189
-188
lines changed

install.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set -e
1212
#
1313
########################################################
1414

15-
SCRIPT_VERSION="v1.1"
15+
SCRIPT_VERSION="v1.2"
1616

1717

1818
print_brake() {
@@ -104,12 +104,12 @@ bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes
104104

105105
while [ "$done" == false ]; do
106106
options=(
107-
"Restore Panel Backup (Only if you have an installation problem.)"
108-
"Install Dracula (Only 1.6.6)"
109-
"Install Enola (Only 1.6.6)"
110-
"Install Twilight (Only 1.6.6)"
111-
"Install Zing Theme (Only 1.6.6)"
112-
"Install Flanco Theme (Only 1.6.6)"
107+
"Restore Panel Backup (To remove some theme and restore your old panel.)"
108+
"Install Dracula (Only 1.6.6 and 1.7.0)"
109+
"Install Enola (Only 1.6.6 and 1.7.0)"
110+
"Install Twilight (Only 1.6.6 and 1.7.0)"
111+
"Install Zing Theme (Only 1.6.6 and 1.7.0)"
112+
"Install Flanco Theme (Only 1.6.6 and 1.7.0)"
113113

114114

115115
"Cancel Installation"

themes/version1.x/Dracula/build.sh

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@ set -e
1515

1616
#### Fixed Variables ####
1717

18-
SCRIPT_VERSION="v1.1"
18+
SCRIPT_VERSION="v1.2"
1919
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
2020

21+
#### Update Variables ####
22+
23+
update_variables() {
24+
CONFIG_FILE="$PTERO/config/app.php"
25+
PANEL_VERSION=$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
26+
}
27+
2128

2229
print_brake() {
2330
for ((n = 0; n < $1; n++)); do
@@ -93,42 +100,40 @@ if [ -d "/var/www/pterodactyl" ]; then
93100
else
94101
PTERO_INSTALL=false
95102
fi
103+
# Update the variables after detection of the pterodactyl installation #
104+
update_variables
96105
}
97106

98107
#### Verify Compatibility ####
99108

100109
compatibility() {
101110
echo
102111
print_brake 57
103-
echo -e "* ${GREEN}Checking if the theme is compatible with your panel...${reset}"
112+
echo -e "* ${GREEN}Checking if the addon is compatible with your panel...${reset}"
104113
print_brake 57
105114
echo
106115
sleep 2
107-
DIR="$PTERO/config/app.php"
108-
VERSION="1.7.0"
109-
if [ -f "$DIR" ]; then
110-
CODE=$(cat "$DIR" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
111-
if [ "$VERSION" == "$CODE" ]; then
112-
echo
113-
print_brake 23
114-
echo -e "* ${GREEN}Compatible Version!${reset}"
115-
print_brake 23
116-
echo
117-
else
118-
echo
119-
print_brake 24
120-
echo -e "* ${red}Incompatible Version!${reset}"
121-
print_brake 24
122-
echo
123-
exit 1
124-
fi
125-
else
126-
echo
127-
print_brake 26
128-
echo -e "* ${red}The file doesn't exist!${reset}"
129-
print_brake 26
130-
echo
131-
exit 1
116+
if [ -f "$CONFIG_FILE" ]; then
117+
if [ "$PANEL_VERSION" == "1.6.6" ]; then
118+
echo
119+
print_brake 23
120+
echo -e "* ${GREEN}Compatible Version!${reset}"
121+
print_brake 23
122+
echo
123+
elif [ "$PANEL_VERSION" == "1.7.0" ]; then
124+
echo
125+
print_brake 23
126+
echo -e "* ${GREEN}Compatible Version!${reset}"
127+
print_brake 23
128+
echo
129+
else
130+
echo
131+
print_brake 24
132+
echo -e "* ${red}Incompatible Version!${reset}"
133+
print_brake 24
134+
echo
135+
exit 1
136+
fi
132137
fi
133138
}
134139

@@ -145,15 +150,11 @@ case "$OS" in
145150
debian | ubuntu)
146151
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
147152
;;
153+
centos)
154+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
155+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
156+
;;
148157
esac
149-
150-
if [ "$OS_VER_MAJOR" == "7" ]; then
151-
curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
152-
fi
153-
154-
if [ "$OS_VER_MAJOR" == "8" ]; then
155-
curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
156-
fi
157158
}
158159

159160

@@ -238,7 +239,7 @@ fi
238239
bye() {
239240
print_brake 50
240241
echo
241-
echo -e "* ${GREEN}The theme ${YELLOW}Dracula${GREEN} was successfully installed."
242+
echo -e "${GREEN}* The theme ${YELLOW}Dracula${GREEN} was successfully installed."
242243
echo -e "* A security backup of your panel has been created."
243244
echo -e "* Thank you for using this script."
244245
echo -e "* Support group: ${YELLOW}$(hyperlink "$SUPPORT_LINK")${reset}"

themes/version1.x/Enola/build.sh

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@ set -e
1515

1616
#### Fixed Variables ####
1717

18-
SCRIPT_VERSION="v1.1"
18+
SCRIPT_VERSION="v1.2"
1919
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
2020

21+
#### Update Variables ####
22+
23+
update_variables() {
24+
CONFIG_FILE="$PTERO/config/app.php"
25+
PANEL_VERSION=$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
26+
}
27+
2128

2229
print_brake() {
2330
for ((n = 0; n < $1; n++)); do
@@ -93,42 +100,40 @@ if [ -d "/var/www/pterodactyl" ]; then
93100
else
94101
PTERO_INSTALL=false
95102
fi
103+
# Update the variables after detection of the pterodactyl installation #
104+
update_variables
96105
}
97106

98107
#### Verify Compatibility ####
99108

100109
compatibility() {
101110
echo
102111
print_brake 57
103-
echo -e "* ${GREEN}Checking if the theme is compatible with your panel...${reset}"
112+
echo -e "* ${GREEN}Checking if the addon is compatible with your panel...${reset}"
104113
print_brake 57
105114
echo
106115
sleep 2
107-
DIR="$PTERO/config/app.php"
108-
VERSION="1.7.0"
109-
if [ -f "$DIR" ]; then
110-
CODE=$(cat "$DIR" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
111-
if [ "$VERSION" == "$CODE" ]; then
112-
echo
113-
print_brake 23
114-
echo -e "* ${GREEN}Compatible Version!${reset}"
115-
print_brake 23
116-
echo
117-
else
118-
echo
119-
print_brake 24
120-
echo -e "* ${red}Incompatible Version!${reset}"
121-
print_brake 24
122-
echo
123-
exit 1
124-
fi
125-
else
126-
echo
127-
print_brake 26
128-
echo -e "* ${red}The file doesn't exist!${reset}"
129-
print_brake 26
130-
echo
131-
exit 1
116+
if [ -f "$CONFIG_FILE" ]; then
117+
if [ "$PANEL_VERSION" == "1.6.6" ]; then
118+
echo
119+
print_brake 23
120+
echo -e "* ${GREEN}Compatible Version!${reset}"
121+
print_brake 23
122+
echo
123+
elif [ "$PANEL_VERSION" == "1.7.0" ]; then
124+
echo
125+
print_brake 23
126+
echo -e "* ${GREEN}Compatible Version!${reset}"
127+
print_brake 23
128+
echo
129+
else
130+
echo
131+
print_brake 24
132+
echo -e "* ${red}Incompatible Version!${reset}"
133+
print_brake 24
134+
echo
135+
exit 1
136+
fi
132137
fi
133138
}
134139

@@ -145,15 +150,11 @@ case "$OS" in
145150
debian | ubuntu)
146151
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
147152
;;
153+
centos)
154+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
155+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
156+
;;
148157
esac
149-
150-
if [ "$OS_VER_MAJOR" == "7" ]; then
151-
curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
152-
fi
153-
154-
if [ "$OS_VER_MAJOR" == "8" ]; then
155-
curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
156-
fi
157158
}
158159

159160

@@ -220,6 +221,7 @@ echo
220221
print_brake 25
221222
echo -e "* ${GREEN}Producing panel...${reset}"
222223
print_brake 25
224+
echo
223225
if [ -d "$PTERO/node_modules" ]; then
224226
cd "$PTERO"
225227
yarn add @emotion/react
@@ -237,7 +239,7 @@ fi
237239
bye() {
238240
print_brake 50
239241
echo
240-
echo -e "* ${GREEN}The theme ${YELLOW}Enola${GREEN} was successfully installed."
242+
echo -e "${GREEN}* The theme ${YELLOW}Enola${GREEN} was successfully installed."
241243
echo -e "* A security backup of your panel has been created."
242244
echo -e "* Thank you for using this script."
243245
echo -e "* Support group: ${YELLOW}$(hyperlink "$SUPPORT_LINK")${reset}"

themes/version1.x/FlancoTheme/build.sh

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@ set -e
1515

1616
#### Fixed Variables ####
1717

18-
SCRIPT_VERSION="v1.1"
18+
SCRIPT_VERSION="v1.2"
1919
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
2020

21+
#### Update Variables ####
22+
23+
update_variables() {
24+
CONFIG_FILE="$PTERO/config/app.php"
25+
PANEL_VERSION=$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
26+
}
27+
2128

2229
print_brake() {
2330
for ((n = 0; n < $1; n++)); do
@@ -93,42 +100,40 @@ if [ -d "/var/www/pterodactyl" ]; then
93100
else
94101
PTERO_INSTALL=false
95102
fi
103+
# Update the variables after detection of the pterodactyl installation #
104+
update_variables
96105
}
97106

98107
#### Verify Compatibility ####
99108

100109
compatibility() {
101110
echo
102111
print_brake 57
103-
echo -e "* ${GREEN}Checking if the theme is compatible with your panel...${reset}"
112+
echo -e "* ${GREEN}Checking if the addon is compatible with your panel...${reset}"
104113
print_brake 57
105114
echo
106115
sleep 2
107-
DIR="$PTERO/config/app.php"
108-
VERSION="1.7.0"
109-
if [ -f "$DIR" ]; then
110-
CODE=$(cat "$DIR" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
111-
if [ "$VERSION" == "$CODE" ]; then
112-
echo
113-
print_brake 23
114-
echo -e "* ${GREEN}Compatible Version!${reset}"
115-
print_brake 23
116-
echo
117-
else
118-
echo
119-
print_brake 24
120-
echo -e "* ${red}Incompatible Version!${reset}"
121-
print_brake 24
122-
echo
123-
exit 1
124-
fi
125-
else
126-
echo
127-
print_brake 26
128-
echo -e "* ${red}The file doesn't exist!${reset}"
129-
print_brake 26
130-
echo
131-
exit 1
116+
if [ -f "$CONFIG_FILE" ]; then
117+
if [ "$PANEL_VERSION" == "1.6.6" ]; then
118+
echo
119+
print_brake 23
120+
echo -e "* ${GREEN}Compatible Version!${reset}"
121+
print_brake 23
122+
echo
123+
elif [ "$PANEL_VERSION" == "1.7.0" ]; then
124+
echo
125+
print_brake 23
126+
echo -e "* ${GREEN}Compatible Version!${reset}"
127+
print_brake 23
128+
echo
129+
else
130+
echo
131+
print_brake 24
132+
echo -e "* ${red}Incompatible Version!${reset}"
133+
print_brake 24
134+
echo
135+
exit 1
136+
fi
132137
fi
133138
}
134139

@@ -143,17 +148,13 @@ print_brake 30
143148
echo
144149
case "$OS" in
145150
debian | ubuntu)
146-
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs && sudo apt-get install -y zip
151+
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
152+
;;
153+
centos)
154+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
155+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
147156
;;
148157
esac
149-
150-
if [ "$OS_VER_MAJOR" == "7" ]; then
151-
curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn && sudo yum install -y zip
152-
fi
153-
154-
if [ "$OS_VER_MAJOR" == "8" ]; then
155-
curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs && sudo dnf install -y zip
156-
fi
157158
}
158159

159160

@@ -211,6 +212,7 @@ echo
211212
print_brake 25
212213
echo -e "* ${GREEN}Producing panel...${reset}"
213214
print_brake 25
215+
echo
214216
if [ -d "$PTERO/node_modules" ]; then
215217
cd "$PTERO"
216218
yarn add @emotion/react
@@ -228,7 +230,7 @@ fi
228230
bye() {
229231
print_brake 50
230232
echo
231-
echo -e "* ${GREEN}The theme ${YELLOW}Flanco Theme${GREEN} was successfully installed."
233+
echo -e "${GREEN}* The theme ${YELLOW}Flanco Theme${GREEN} was successfully installed."
232234
echo -e "* A security backup of your panel has been created."
233235
echo -e "* Thank you for using this script."
234236
echo -e "* Support group: ${YELLOW}$(hyperlink "$SUPPORT_LINK")${reset}"

0 commit comments

Comments
 (0)