1414# #######################################################
1515
1616# ### Variables ####
17- SCRIPT_VERSION=" v0.8.7 "
17+ SCRIPT_VERSION=" v0.8.8 "
1818SUPPORT_LINK=" https://discord.gg/buDBbSGJmQ"
1919PTERO=" /var/www/pterodactyl"
2020
@@ -72,6 +72,28 @@ check_distro() {
7272 OS_VER_MAJOR=$( echo " $OS_VER " | cut -d. -f1)
7373}
7474
75+ # ### Find where pterodactyl is installed ####
76+
77+ find_pterodactyl () {
78+ echo
79+ print_brake 47
80+ echo -e " * ${GREEN} Looking for your pterodactyl installation...${reset} "
81+ print_brake 47
82+ echo
83+ sleep 2
84+ if [ -d " /var/www/pterodactyl" ]; then
85+ PTERO_INSTALL=true
86+ PTERO=" /var/www/pterodactyl"
87+ elif [ -d " /var/www/panel" ]; then
88+ PTERO_INSTALL=true
89+ PTERO=" /var/www/panel"
90+ elif [ -d " /var/www/ptero" ]; then
91+ PTERO_INSTALL=true
92+ PTERO=" /var/www/ptero"
93+ else
94+ PTERO_INSTALL=false
95+ fi
96+ }
7597
7698# ### Verify Compatibility ####
7799
@@ -83,9 +105,9 @@ print_brake 57
83105echo
84106sleep 2
85107DIR=" $PTERO /config/app.php"
86- CODE= " 'version' => ' 1.6.6', "
108+ VERSION= " 1.6.6"
87109if [ -f " $DIR " ]; then
88- VERSION =$( cat " $DIR " | grep -n ^ | grep ^12: | cut -d: -f2)
110+ CODE =$( cat " $DIR " | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed " s/'//g " )
89111 if [ " $VERSION " == " $CODE " ]; then
90112 echo
91113 print_brake 23
@@ -214,10 +236,25 @@ print_brake 50
214236
215237# ### Exec Script ####
216238check_distro
217- compatibility
218- dependencies
219- backup
220- download_files
221- production
222- bye
239+ find_pterodactyl
240+ if [ " $PTERO_INSTALL " == true ]; then
241+ echo
242+ print_brake 66
243+ echo -e " * ${GREEN} Installation of the panel found, continuing the installation...${reset} "
244+ print_brake 66
245+ echo
246+ compatibility
247+ dependencies
248+ backup
249+ download_files
250+ production
251+ bye
252+ elif [ " $PTERO_INSTALL " == false ]; then
253+ echo
254+ print_brake 66
255+ echo -e " * ${red} The installation of your panel could not be located, aborting...${reset} "
256+ print_brake 66
257+ echo
258+ exit 1
259+ fi
223260
0 commit comments