Skip to content

Commit 9349119

Browse files
committed
Update
1 parent d09cf73 commit 9349119

File tree

6 files changed

+64
-9
lines changed

6 files changed

+64
-9
lines changed

install.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ curl --silent \
2121
sed -E 's/.*"([^"]+)".*/\1/'
2222
}
2323

24+
# Get the latest and penultimate version of the pterodactyl #
25+
get_branch() {
26+
curl --silent \
27+
-H "Accept: application/vnd.github.v3+json" \
28+
https://api.github.com/repos/pterodactyl/panel/releases |
29+
grep '"tag_name":' |
30+
sed -E 's/.*"([^"]+)".*/\1/' |
31+
sed "s/[v]//g"
32+
}
33+
2434
GITHUB_STATUS_URL="https://www.githubstatus.com"
2535
SCRIPT_VERSION="$(get_release)"
2636

@@ -121,11 +131,15 @@ bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes
121131

122132

123133
while [ "$done" == false ]; do
134+
CREATE_ARRAY=$'\n' read -d "\034" -r -a array <<<"$(get_branch)\034" # https://unix.stackexchange.com/a/628543
135+
LATEST_VERSION="${array[0]}"
136+
PENULTIMATE_VERSION="${array[1]}"
137+
124138
options=(
125139
"Restore Panel Backup (Only if you have an installation problem.)"
126-
"Install Dracula (Only 1.6.6 and 1.7.0)"
127-
"Install Enola (Only 1.6.6 and 1.7.0)"
128-
"Install Twilight (Only 1.6.6 and 1.7.0)"
140+
"Install Dracula (Only $PENULTIMATE_VERSION and $LATEST_VERSION)"
141+
"Install Enola (Only $PENULTIMATE_VERSION and $LATEST_VERSION)"
142+
"Install Twilight (Only $PENULTIMATE_VERSION and $LATEST_VERSION)"
129143
"Install Zing Theme (Only 1.6.6 and 1.7.0)"
130144
"Install Flanco Theme (Only 1.6.6 and 1.7.0)"
131145
"Install Background Video (Only 1.6.6 and 1.7.0)"
-67 Bytes
Binary file not shown.

themes/version1.x/BackgroundVideo/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ compatibility() {
127127
print "Checking if the addon is compatible with your panel..."
128128

129129
sleep 2
130-
if [ "$PANEL_VERSION" == "1.6.6" ] || [ "$PANEL_VERSION" == "1.7.0" ]; then
130+
if [ "$PANEL_VERSION" == "1.7.0" ] || [ "$PANEL_VERSION" == "1.8.1" ]; then
131131
print "Compatible Version!"
132132
else
133133
print_error "Incompatible Version!"

themes/version1.x/Dracula/build.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,33 @@ fi
120120
update_variables
121121
}
122122

123+
# Get the latest and penultimate version of the pterodactyl #
124+
get_branch() {
125+
curl --silent \
126+
-H "Accept: application/vnd.github.v3+json" \
127+
https://api.github.com/repos/pterodactyl/panel/releases |
128+
grep '"tag_name":' |
129+
sed -E 's/.*"([^"]+)".*/\1/' |
130+
sed "s/[v]//g"
131+
}
132+
123133
# Verify Compatibility #
124134
compatibility() {
125135
print "Checking if the addon is compatible with your panel..."
126136

137+
CREATE_ARRAY=$'\n' read -d "\034" -r -a array <<<"$(get_branch)\034" # https://unix.stackexchange.com/a/628543
138+
LATEST_VERSION="${array[0]}"
139+
PENULTIMATE_VERSION="${array[1]}"
140+
127141
sleep 2
128-
if [ "$PANEL_VERSION" == "1.6.6" ] || [ "$PANEL_VERSION" == "1.7.0" ]; then
142+
if [ "$PANEL_VERSION" == "$PENULTIMATE_VERSION" ] || [ "$PANEL_VERSION" == "$LATEST_VERSION" ]; then
129143
print "Compatible Version!"
130144
else
131145
print_error "Incompatible Version!"
132146
exit 1
133147
fi
134148
}
135149

136-
137150
# Install Dependencies #
138151
dependencies() {
139152
print "Installing dependencies..."

themes/version1.x/Enola/build.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,26 @@ fi
120120
update_variables
121121
}
122122

123+
# Get the latest and penultimate version of the pterodactyl #
124+
get_branch() {
125+
curl --silent \
126+
-H "Accept: application/vnd.github.v3+json" \
127+
https://api.github.com/repos/pterodactyl/panel/releases |
128+
grep '"tag_name":' |
129+
sed -E 's/.*"([^"]+)".*/\1/' |
130+
sed "s/[v]//g"
131+
}
132+
123133
# Verify Compatibility #
124134
compatibility() {
125135
print "Checking if the addon is compatible with your panel..."
126136

137+
CREATE_ARRAY=$'\n' read -d "\034" -r -a array <<<"$(get_branch)\034" # https://unix.stackexchange.com/a/628543
138+
LATEST_VERSION="${array[0]}"
139+
PENULTIMATE_VERSION="${array[1]}"
140+
127141
sleep 2
128-
if [ "$PANEL_VERSION" == "1.6.6" ] || [ "$PANEL_VERSION" == "1.7.0" ]; then
142+
if [ "$PANEL_VERSION" == "$PENULTIMATE_VERSION" ] || [ "$PANEL_VERSION" == "$LATEST_VERSION" ]; then
129143
print "Compatible Version!"
130144
else
131145
print_error "Incompatible Version!"

themes/version1.x/Twilight/build.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,29 @@ fi
120120
update_variables
121121
}
122122

123+
# Get the latest and penultimate version of the pterodactyl #
124+
get_branch() {
125+
curl --silent \
126+
-H "Accept: application/vnd.github.v3+json" \
127+
https://api.github.com/repos/pterodactyl/panel/releases |
128+
grep '"tag_name":' |
129+
sed -E 's/.*"([^"]+)".*/\1/' |
130+
sed "s/[v]//g"
131+
}
132+
123133
# Verify Compatibility #
124134
compatibility() {
125135
print "Checking if the addon is compatible with your panel..."
126136

137+
CREATE_ARRAY=$'\n' read -d "\034" -r -a array <<<"$(get_branch)\034" # https://unix.stackexchange.com/a/628543
138+
LATEST_VERSION="${array[0]}"
139+
PENULTIMATE_VERSION="${array[1]}"
140+
127141
sleep 2
128-
if [ "$PANEL_VERSION" == "1.6.6" ] || [ "$PANEL_VERSION" == "1.7.0" ]; then
142+
if [ "$PANEL_VERSION" == "$PENULTIMATE_VERSION" ] || [ "$PANEL_VERSION" == "$LATEST_VERSION" ]; then
129143
print "Compatible Version!"
130144
else
131-
print "Incompatible Version!"
145+
print_error "Incompatible Version!"
132146
exit 1
133147
fi
134148
}

0 commit comments

Comments
 (0)