@@ -15,9 +15,16 @@ set -e
1515
1616# ### Fixed Variables ####
1717
18- SCRIPT_VERSION=" v1.1 "
18+ SCRIPT_VERSION=" v1.2 "
1919SUPPORT_LINK=" https://discord.gg/buDBbSGJmQ"
2020
21+ # ### Update Variables ####
22+
23+ update_variables () {
24+ CONFIG_FILE=" $PTERO /config/app.php"
25+ PANEL_VERSION=$( cat " $CONFIG_FILE " | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed " s/'//g" )
26+ }
27+
2128
2229print_brake () {
2330 for (( n = 0 ; n < $1 ; n++ )) ; do
@@ -93,42 +100,40 @@ if [ -d "/var/www/pterodactyl" ]; then
93100 else
94101 PTERO_INSTALL=false
95102fi
103+ # Update the variables after detection of the pterodactyl installation #
104+ update_variables
96105}
97106
98107# ### Verify Compatibility ####
99108
100109compatibility () {
101110echo
102111print_brake 57
103- echo -e " * ${GREEN} Checking if the theme is compatible with your panel...${reset} "
112+ echo -e " * ${GREEN} Checking if the addon is compatible with your panel...${reset} "
104113print_brake 57
105114echo
106115sleep 2
107- DIR=" $PTERO /config/app.php"
108- VERSION=" 1.7.0"
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
116+ if [ -f " $CONFIG_FILE " ]; then
117+ if [ " $PANEL_VERSION " == " 1.6.6" ]; then
118+ echo
119+ print_brake 23
120+ echo -e " * ${GREEN} Compatible Version!${reset} "
121+ print_brake 23
122+ echo
123+ elif [ " $PANEL_VERSION " == " 1.7.0" ]; then
124+ echo
125+ print_brake 23
126+ echo -e " * ${GREEN} Compatible Version!${reset} "
127+ print_brake 23
128+ echo
129+ else
130+ echo
131+ print_brake 24
132+ echo -e " * ${red} Incompatible Version!${reset} "
133+ print_brake 24
134+ echo
135+ exit 1
136+ fi
132137fi
133138}
134139
@@ -143,17 +148,13 @@ print_brake 30
143148echo
144149case " $OS " in
145150debian | ubuntu)
146- curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs && sudo apt-get install -y zip
151+ curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
152+ ;;
153+ centos)
154+ [ " $OS_VER_MAJOR " == " 7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
155+ [ " $OS_VER_MAJOR " == " 8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
147156;;
148157esac
149-
150- if [ " $OS_VER_MAJOR " == " 7" ]; then
151- curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn && sudo yum install -y zip
152- fi
153-
154- if [ " $OS_VER_MAJOR " == " 8" ]; then
155- curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs && sudo dnf install -y zip
156- fi
157158}
158159
159160
211212print_brake 25
212213echo -e " * ${GREEN} Producing panel...${reset} "
213214print_brake 25
215+ echo
214216if [ -d " $PTERO /node_modules" ]; then
215217 cd " $PTERO "
216218 yarn add @emotion/react
228230bye () {
229231print_brake 50
230232echo
231- echo -e " * ${GREEN} The theme ${YELLOW} Flanco Theme${GREEN} was successfully installed."
233+ echo -e " ${GREEN} * The theme ${YELLOW} Flanco Theme${GREEN} was successfully installed."
232234echo -e " * A security backup of your panel has been created."
233235echo -e " * Thank you for using this script."
234236echo -e " * Support group: ${YELLOW} $( hyperlink " $SUPPORT_LINK " ) ${reset} "
0 commit comments