@@ -25,6 +25,7 @@ update_variables() {
2525CONFIG_FILE=" $PTERO /config/app.php"
2626PANEL_VERSION=" $( cat " $CONFIG_FILE " | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed " s/'//g" ) "
2727VIDEO_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
205206cd " $PTERO "
206207mkdir -p temp
207208cd 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
209211tar -xzvf BackgroundVideo.tar.gz
210212cd BackgroundVideo
211213cp -rf -- * " $PTERO "
212214cd " $PTERO "
213215rm -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
218239detect_video () {
@@ -252,6 +273,32 @@ mkdir -p "$INFORMATIONS"
252273echo " $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
257304production () {
@@ -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
0 commit comments