Skip to content

Commit 5a684f7

Browse files
committed
Update
1 parent c9f586e commit 5a684f7

File tree

3 files changed

+52
-10
lines changed

3 files changed

+52
-10
lines changed

install.sh

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

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

1717

1818
print_brake() {

themes/version1.x/BackgroundVideo/build.sh

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ update_variables() {
2525
CONFIG_FILE="$PTERO/config/app.php"
2626
PANEL_VERSION="$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")"
2727
VIDEO_FILE="$(cd "$PTERO/public" && find . -iname '*.mp4' | tail -1 | sed "s/.\///g")"
28+
ZING="$PTERO/resources/scripts/components/SidePanel.tsx"
2829
}
2930

3031

@@ -205,14 +206,34 @@ echo
205206
cd "$PTERO"
206207
mkdir -p temp
207208
cd temp
208-
curl -sSLo BackgroundVideo.tar.gz https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION}/themes/version1.x/BackgroundVideo/BackgroundVideo.tar.gz
209+
#curl -sSLo BackgroundVideo.tar.gz https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION}/themes/version1.x/BackgroundVideo/BackgroundVideo.tar.gz
210+
curl -sSLo BackgroundVideo.tar.gz https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/Big_Update/themes/version1.x/BackgroundVideo/BackgroundVideo.tar.gz
209211
tar -xzvf BackgroundVideo.tar.gz
210212
cd BackgroundVideo
211213
cp -rf -- * "$PTERO"
212214
cd "$PTERO"
213215
rm -r temp
214216
}
215217

218+
#### Check if it is already installed ####
219+
220+
verify_installation() {
221+
if grep '<video autoPlay muted loop className="video">' "$PTERO/resources/scripts/components/App.tsx"; then
222+
print_brake 61
223+
echo -e "* ${red}This theme is already installed in your panel, aborting...${reset}"
224+
print_brake 61
225+
exit 1
226+
else
227+
dependencies
228+
backup
229+
download_files
230+
detect_video
231+
write_informations
232+
production
233+
bye
234+
fi
235+
}
236+
216237
#### Detect if the user has passed your video file in mp4 format ####
217238

218239
detect_video() {
@@ -252,6 +273,32 @@ mkdir -p "$INFORMATIONS"
252273
echo "$VIDEO_FILE" >> "$INFORMATIONS/background.txt"
253274
}
254275

276+
#### Check if another conflicting addon is installed ####
277+
278+
check_conflict() {
279+
echo
280+
print_brake 66
281+
echo -e "* ${GREEN}Checking if a similar/conflicting addon is already installed...${reset}"
282+
print_brake 66
283+
echo
284+
sleep 2
285+
if [ -f "$PTERO/resources/scripts/user.css" ]; then
286+
echo
287+
print_brake 73
288+
echo -e "* ${red}The theme ${YELLOW}Dracula, Enola or Twilight ${red}is already installed, aborting...${reset}"
289+
print_brake 73
290+
echo
291+
exit 1
292+
elif [ -f "$ZING" ]; then
293+
echo
294+
print_brake 56
295+
echo -e "* ${red}The theme ${YELLOW}ZingTheme ${red}is already installed, aborting...${reset}"
296+
print_brake 56
297+
echo
298+
exit 1
299+
fi
300+
}
301+
255302
#### Panel Production ####
256303

257304
production() {
@@ -296,13 +343,8 @@ if [ "$PTERO_INSTALL" == true ]; then
296343
print_brake 66
297344
echo
298345
compatibility
299-
dependencies
300-
backup
301-
download_files
302-
detect_video
303-
write_informations
304-
production
305-
bye
346+
check_conflict
347+
verify_installation
306348
elif [ "$PTERO_INSTALL" == false ]; then
307349
echo
308350
print_brake 66

themes/version1.x/ZingTheme/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ rm -rf temp
211211
verify_installation() {
212212
if [ -f "$ZING" ]; then
213213
print_brake 61
214-
echo -e "* ${red}This addon is already installed in your panel, aborting...${reset}"
214+
echo -e "* ${red}This theme is already installed in your panel, aborting...${reset}"
215215
print_brake 61
216216
exit 1
217217
else

0 commit comments

Comments
 (0)