File tree Expand file tree Collapse file tree 7 files changed +165
-164
lines changed
Expand file tree Collapse file tree 7 files changed +165
-164
lines changed Original file line number Diff line number Diff line change 1212#
1313# #######################################################
1414
15- SCRIPT_VERSION=" v1.2 "
15+ SCRIPT_VERSION=" v1.3 "
1616
1717
1818print_brake () {
@@ -102,11 +102,7 @@ bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes
102102}
103103
104104BackgroundVideo () {
105- bash <( curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/Big_Update/themes/version1.x/BackgroundVideo/build.sh)
106- }
107-
108- backup () {
109- bash <( curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/Big_Update/backup.sh)
105+ bash <( curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION} /themes/version1.x/BackgroundVideo/build.sh)
110106}
111107
112108
@@ -119,7 +115,6 @@ while [ "$done" == false ]; do
119115 " Install Zing Theme (Only 1.6.6)"
120116 " Install Flanco Theme (Only 1.6.6)"
121117 " Install Background Video (Only 1.6.6)"
122- " bkp"
123118
124119
125120 " Cancel Installation"
@@ -133,7 +128,6 @@ while [ "$done" == false ]; do
133128 " ZingTheme"
134129 " FlancoTheme"
135130 " BackgroundVideo"
136- " backup"
137131
138132
139133 " cancel"
Original file line number Diff line number Diff line change @@ -206,34 +206,14 @@ echo
206206cd " $PTERO "
207207mkdir -p temp
208208cd temp
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
209+ curl -sSLo BackgroundVideo.tar.gz https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION} /themes/version1.x/BackgroundVideo/BackgroundVideo.tar.gz
211210tar -xzvf BackgroundVideo.tar.gz
212211cd BackgroundVideo
213212cp -rf -- * " $PTERO "
214213cd " $PTERO "
215214rm -r temp
216215}
217216
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-
237217# ### Detect if the user has passed your video file in mp4 format ####
238218
239219detect_video () {
@@ -273,6 +253,25 @@ mkdir -p "$INFORMATIONS"
273253echo " $VIDEO_FILE " >> " $INFORMATIONS /background.txt"
274254}
275255
256+ # ### Check if it is already installed ####
257+
258+ verify_installation () {
259+ if grep ' <video autoPlay muted loop className="video">' " $PTERO /resources/scripts/components/App.tsx" ; then
260+ print_brake 61
261+ echo -e " * ${red} This theme is already installed in your panel, aborting...${reset} "
262+ print_brake 61
263+ exit 1
264+ else
265+ dependencies
266+ backup
267+ download_files
268+ detect_video
269+ write_informations
270+ production
271+ bye
272+ fi
273+ }
274+
276275# ### Check if another conflicting addon is installed ####
277276
278277check_conflict () {
Original file line number Diff line number Diff line change @@ -15,9 +15,14 @@ set -e
1515
1616# ### Fixed Variables ####
1717
18- SCRIPT_VERSION=" v1.1 "
18+ SCRIPT_VERSION=" v1.3 "
1919SUPPORT_LINK=" https://discord.gg/buDBbSGJmQ"
2020
21+ # ### Update Variables ####
22+
23+ update_variables () {
24+ PANEL_VERSION=$( cat " $CONFIG_FILE " | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed " s/'//g" )
25+ }
2126
2227print_brake () {
2328 for (( n = 0 ; n < $1 ; n++ )) ; do
@@ -93,42 +98,40 @@ if [ -d "/var/www/pterodactyl" ]; then
9398 else
9499 PTERO_INSTALL=false
95100fi
101+ # Update the variables after detection of the pterodactyl installation #
102+ update_variables
96103}
97104
98105# ### Verify Compatibility ####
99106
100107compatibility () {
101108echo
102109print_brake 57
103- echo -e " * ${GREEN} Checking if the theme is compatible with your panel...${reset} "
110+ echo -e " * ${GREEN} Checking if the addon is compatible with your panel...${reset} "
104111print_brake 57
105112echo
106113sleep 2
107- DIR=" $PTERO /config/app.php"
108- VERSION=" 1.6.6"
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
114+ if [ -f " $CONFIG_FILE " ]; then
115+ if [ " $PANEL_VERSION " == " 1.6.6" ]; then
116+ echo
117+ print_brake 23
118+ echo -e " * ${GREEN} Compatible Version!${reset} "
119+ print_brake 23
120+ echo
121+ elif [ " $PANEL_VERSION " == " 1.7.0" ]; then
122+ echo
123+ print_brake 23
124+ echo -e " * ${GREEN} Compatible Version!${reset} "
125+ print_brake 23
126+ echo
127+ else
128+ echo
129+ print_brake 24
130+ echo -e " * ${red} Incompatible Version!${reset} "
131+ print_brake 24
132+ echo
133+ exit 1
134+ fi
132135fi
133136}
134137
Original file line number Diff line number Diff line change @@ -15,9 +15,14 @@ set -e
1515
1616# ### Fixed Variables ####
1717
18- SCRIPT_VERSION=" v1.1 "
18+ SCRIPT_VERSION=" v1.3 "
1919SUPPORT_LINK=" https://discord.gg/buDBbSGJmQ"
2020
21+ # ### Update Variables ####
22+
23+ update_variables () {
24+ PANEL_VERSION=$( cat " $CONFIG_FILE " | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed " s/'//g" )
25+ }
2126
2227print_brake () {
2328 for (( n = 0 ; n < $1 ; n++ )) ; do
@@ -93,42 +98,40 @@ if [ -d "/var/www/pterodactyl" ]; then
9398 else
9499 PTERO_INSTALL=false
95100fi
101+ # Update the variables after detection of the pterodactyl installation #
102+ update_variables
96103}
97104
98105# ### Verify Compatibility ####
99106
100107compatibility () {
101108echo
102109print_brake 57
103- echo -e " * ${GREEN} Checking if the theme is compatible with your panel...${reset} "
110+ echo -e " * ${GREEN} Checking if the addon is compatible with your panel...${reset} "
104111print_brake 57
105112echo
106113sleep 2
107- DIR=" $PTERO /config/app.php"
108- VERSION=" 1.6.6"
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
114+ if [ -f " $CONFIG_FILE " ]; then
115+ if [ " $PANEL_VERSION " == " 1.6.6" ]; then
116+ echo
117+ print_brake 23
118+ echo -e " * ${GREEN} Compatible Version!${reset} "
119+ print_brake 23
120+ echo
121+ elif [ " $PANEL_VERSION " == " 1.7.0" ]; then
122+ echo
123+ print_brake 23
124+ echo -e " * ${GREEN} Compatible Version!${reset} "
125+ print_brake 23
126+ echo
127+ else
128+ echo
129+ print_brake 24
130+ echo -e " * ${red} Incompatible Version!${reset} "
131+ print_brake 24
132+ echo
133+ exit 1
134+ fi
132135fi
133136}
134137
Original file line number Diff line number Diff line change @@ -15,9 +15,14 @@ set -e
1515
1616# ### Fixed Variables ####
1717
18- SCRIPT_VERSION=" v1.1 "
18+ SCRIPT_VERSION=" v1.3 "
1919SUPPORT_LINK=" https://discord.gg/buDBbSGJmQ"
2020
21+ # ### Update Variables ####
22+
23+ update_variables () {
24+ PANEL_VERSION=$( cat " $CONFIG_FILE " | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed " s/'//g" )
25+ }
2126
2227print_brake () {
2328 for (( n = 0 ; n < $1 ; n++ )) ; do
@@ -93,42 +98,40 @@ if [ -d "/var/www/pterodactyl" ]; then
9398 else
9499 PTERO_INSTALL=false
95100fi
101+ # Update the variables after detection of the pterodactyl installation #
102+ update_variables
96103}
97104
98105# ### Verify Compatibility ####
99106
100107compatibility () {
101108echo
102109print_brake 57
103- echo -e " * ${GREEN} Checking if the theme is compatible with your panel...${reset} "
110+ echo -e " * ${GREEN} Checking if the addon is compatible with your panel...${reset} "
104111print_brake 57
105112echo
106113sleep 2
107- DIR=" $PTERO /config/app.php"
108- VERSION=" 1.6.6"
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
114+ if [ -f " $CONFIG_FILE " ]; then
115+ if [ " $PANEL_VERSION " == " 1.6.6" ]; then
116+ echo
117+ print_brake 23
118+ echo -e " * ${GREEN} Compatible Version!${reset} "
119+ print_brake 23
120+ echo
121+ elif [ " $PANEL_VERSION " == " 1.7.0" ]; then
122+ echo
123+ print_brake 23
124+ echo -e " * ${GREEN} Compatible Version!${reset} "
125+ print_brake 23
126+ echo
127+ else
128+ echo
129+ print_brake 24
130+ echo -e " * ${red} Incompatible Version!${reset} "
131+ print_brake 24
132+ echo
133+ exit 1
134+ fi
132135fi
133136}
134137
You can’t perform that action at this time.
0 commit comments