Skip to content

Commit bb12b5e

Browse files
committed
Added version checker.
1 parent 3f1ac03 commit bb12b5e

File tree

6 files changed

+208
-16
lines changed

6 files changed

+208
-16
lines changed

install.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set -e
1212
#
1313
########################################################
1414

15-
SCRIPT_VERSION="v0.8.5"
15+
SCRIPT_VERSION="v0.8.6"
1616

1717

1818
print_brake() {
@@ -107,11 +107,11 @@ bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes
107107
while [ "$done" == false ]; do
108108
options=(
109109
"Restore Panel Backup (Only if you have an installation problem.)"
110-
"Install Dracula (Only 1.x)"
111-
"Install Enola (Only 1.x)"
112-
"Install Twilight (Only 1.x)"
113-
"Install Zing Theme (Only 1.x)"
114-
"Install Flanco Theme (Only 1.x)"
110+
"Install Dracula (Only 1.6.6)"
111+
"Install Enola (Only 1.6.6)"
112+
"Install Twilight (Only 1.6.6)"
113+
"Install Zing Theme (Only 1.6.6)"
114+
"Install Flanco Theme (Only 1.6.6)"
115115

116116

117117
"Cancel Installation"

themes/version1.x/Dracula/build.sh

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -e
1313
########################################################
1414

1515
#### Variables ####
16-
SCRIPT_VERSION="v0.8.3"
16+
SCRIPT_VERSION="v0.8.6"
1717
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
1818

1919

@@ -69,6 +69,43 @@ check_distro() {
6969
OS_VER_MAJOR=$(echo "$OS_VER" | cut -d. -f1)
7070
}
7171

72+
#### Verify Compatibility ####
73+
74+
compatibility() {
75+
echo
76+
print_brake 57
77+
echo -e "* ${GREEN}Checking if the theme is compatible with your panel...${reset}"
78+
print_brake 57
79+
echo
80+
sleep 2
81+
DIR="/var/www/pterodactyl/config/app.php"
82+
CODE=" 'version' => '1.6.6',"
83+
if [ -f "$DIR" ]; then
84+
VERSION=$(cat "$DIR" | grep -n ^ | grep ^12: | cut -d: -f2)
85+
if [ "$VERSION" == "$CODE" ]; then
86+
echo
87+
print_brake 23
88+
echo -e "* ${GREEN}Compatible Version!${reset}"
89+
print_brake 23
90+
echo
91+
else
92+
echo
93+
print_brake 24
94+
echo -e "* ${red}Incompatible Version!${reset}"
95+
print_brake 24
96+
echo
97+
exit 1
98+
fi
99+
else
100+
echo
101+
print_brake 26
102+
echo -e "* ${red}The file doesn't exist!${reset}"
103+
print_brake 26
104+
echo
105+
exit 1
106+
fi
107+
}
108+
72109

73110
#### Install Dependencies ####
74111

@@ -80,7 +117,7 @@ print_brake 30
80117
echo
81118
case "$OS" in
82119
debian | ubuntu)
83-
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && apt-get install -y zip
120+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && sudo apt-get install -y zip
84121
;;
85122
esac
86123

@@ -167,6 +204,7 @@ print_brake 50
167204

168205
#### Exec Script ####
169206
check_distro
207+
compatibility
170208
dependencies
171209
backup
172210
download_files

themes/version1.x/Enola/build.sh

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -e
1313
########################################################
1414

1515
#### Variables ####
16-
SCRIPT_VERSION="v0.8.3"
16+
SCRIPT_VERSION="v0.8.6"
1717
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
1818

1919

@@ -69,6 +69,43 @@ check_distro() {
6969
OS_VER_MAJOR=$(echo "$OS_VER" | cut -d. -f1)
7070
}
7171

72+
#### Verify Compatibility ####
73+
74+
compatibility() {
75+
echo
76+
print_brake 57
77+
echo -e "* ${GREEN}Checking if the theme is compatible with your panel...${reset}"
78+
print_brake 57
79+
echo
80+
sleep 2
81+
DIR="/var/www/pterodactyl/config/app.php"
82+
CODE=" 'version' => '1.6.6',"
83+
if [ -f "$DIR" ]; then
84+
VERSION=$(cat "$DIR" | grep -n ^ | grep ^12: | cut -d: -f2)
85+
if [ "$VERSION" == "$CODE" ]; then
86+
echo
87+
print_brake 23
88+
echo -e "* ${GREEN}Compatible Version!${reset}"
89+
print_brake 23
90+
echo
91+
else
92+
echo
93+
print_brake 24
94+
echo -e "* ${red}Incompatible Version!${reset}"
95+
print_brake 24
96+
echo
97+
exit 1
98+
fi
99+
else
100+
echo
101+
print_brake 26
102+
echo -e "* ${red}The file doesn't exist!${reset}"
103+
print_brake 26
104+
echo
105+
exit 1
106+
fi
107+
}
108+
72109

73110
#### Install Dependencies ####
74111

@@ -80,7 +117,7 @@ print_brake 30
80117
echo
81118
case "$OS" in
82119
debian | ubuntu)
83-
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && apt-get install -y zip
120+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && sudo apt-get install -y zip
84121
;;
85122
esac
86123

@@ -167,6 +204,7 @@ print_brake 50
167204

168205
#### Exec Script ####
169206
check_distro
207+
compatibility
170208
dependencies
171209
backup
172210
download_files

themes/version1.x/FlancoTheme/build.sh

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -e
1313
########################################################
1414

1515
#### Variables ####
16-
SCRIPT_VERSION="v0.8.4"
16+
SCRIPT_VERSION="v0.8.6"
1717
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
1818

1919

@@ -70,6 +70,44 @@ check_distro() {
7070
}
7171

7272

73+
#### Verify Compatibility ####
74+
75+
compatibility() {
76+
echo
77+
print_brake 57
78+
echo -e "* ${GREEN}Checking if the theme is compatible with your panel...${reset}"
79+
print_brake 57
80+
echo
81+
sleep 2
82+
DIR="/var/www/pterodactyl/config/app.php"
83+
CODE=" 'version' => '1.6.6',"
84+
if [ -f "$DIR" ]; then
85+
VERSION=$(cat "$DIR" | grep -n ^ | grep ^12: | cut -d: -f2)
86+
if [ "$VERSION" == "$CODE" ]; then
87+
echo
88+
print_brake 23
89+
echo -e "* ${GREEN}Compatible Version!${reset}"
90+
print_brake 23
91+
echo
92+
else
93+
echo
94+
print_brake 24
95+
echo -e "* ${red}Incompatible Version!${reset}"
96+
print_brake 24
97+
echo
98+
exit 1
99+
fi
100+
else
101+
echo
102+
print_brake 26
103+
echo -e "* ${red}The file doesn't exist!${reset}"
104+
print_brake 26
105+
echo
106+
exit 1
107+
fi
108+
}
109+
110+
73111
#### Install Dependencies ####
74112

75113
dependencies() {
@@ -80,7 +118,7 @@ print_brake 30
80118
echo
81119
case "$OS" in
82120
debian | ubuntu)
83-
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && apt-get install -y zip
121+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && sudo apt-get install -y zip
84122
;;
85123
esac
86124

@@ -165,6 +203,7 @@ print_brake 50
165203

166204
#### Exec Script ####
167205
check_distro
206+
compatibility
168207
dependencies
169208
backup
170209
download_files

themes/version1.x/Twilight/build.sh

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -e
1313
########################################################
1414

1515
#### Variables ####
16-
SCRIPT_VERSION="v0.8.3"
16+
SCRIPT_VERSION="v0.8.6"
1717
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
1818

1919

@@ -69,6 +69,43 @@ check_distro() {
6969
OS_VER_MAJOR=$(echo "$OS_VER" | cut -d. -f1)
7070
}
7171

72+
#### Verify Compatibility ####
73+
74+
compatibility() {
75+
echo
76+
print_brake 57
77+
echo -e "* ${GREEN}Checking if the theme is compatible with your panel...${reset}"
78+
print_brake 57
79+
echo
80+
sleep 2
81+
DIR="/var/www/pterodactyl/config/app.php"
82+
CODE=" 'version' => '1.6.6',"
83+
if [ -f "$DIR" ]; then
84+
VERSION=$(cat "$DIR" | grep -n ^ | grep ^12: | cut -d: -f2)
85+
if [ "$VERSION" == "$CODE" ]; then
86+
echo
87+
print_brake 23
88+
echo -e "* ${GREEN}Compatible Version!${reset}"
89+
print_brake 23
90+
echo
91+
else
92+
echo
93+
print_brake 24
94+
echo -e "* ${red}Incompatible Version!${reset}"
95+
print_brake 24
96+
echo
97+
exit 1
98+
fi
99+
else
100+
echo
101+
print_brake 26
102+
echo -e "* ${red}The file doesn't exist!${reset}"
103+
print_brake 26
104+
echo
105+
exit 1
106+
fi
107+
}
108+
72109

73110
#### Install Dependencies ####
74111

@@ -80,7 +117,7 @@ print_brake 30
80117
echo
81118
case "$OS" in
82119
debian | ubuntu)
83-
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && apt-get install -y zip
120+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && sudo apt-get install -y zip
84121
;;
85122
esac
86123

@@ -167,6 +204,7 @@ print_brake 50
167204

168205
#### Exec Script ####
169206
check_distro
207+
compatibility
170208
dependencies
171209
backup
172210
download_files

themes/version1.x/ZingTheme/build.sh

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -e
1313
########################################################
1414

1515
#### Variables ####
16-
SCRIPT_VERSION="v0.8.5"
16+
SCRIPT_VERSION="v0.8.6"
1717
SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
1818

1919

@@ -34,6 +34,7 @@ hyperlink() {
3434

3535
GREEN="\e[0;92m"
3636
YELLOW="\033[1;33m"
37+
red='\033[0;31m'
3738
reset="\e[0m"
3839

3940

@@ -69,6 +70,43 @@ check_distro() {
6970
OS_VER_MAJOR=$(echo "$OS_VER" | cut -d. -f1)
7071
}
7172

73+
#### Verify Compatibility ####
74+
75+
compatibility() {
76+
echo
77+
print_brake 57
78+
echo -e "* ${GREEN}Checking if the theme is compatible with your panel...${reset}"
79+
print_brake 57
80+
echo
81+
sleep 2
82+
DIR="/var/www/pterodactyl/config/app.php"
83+
CODE=" 'version' => '1.6.6',"
84+
if [ -f "$DIR" ]; then
85+
VERSION=$(cat "$DIR" | grep -n ^ | grep ^12: | cut -d: -f2)
86+
if [ "$VERSION" == "$CODE" ]; then
87+
echo
88+
print_brake 23
89+
echo -e "* ${GREEN}Compatible Version!${reset}"
90+
print_brake 23
91+
echo
92+
else
93+
echo
94+
print_brake 24
95+
echo -e "* ${red}Incompatible Version!${reset}"
96+
print_brake 24
97+
echo
98+
exit 1
99+
fi
100+
else
101+
echo
102+
print_brake 26
103+
echo -e "* ${red}The file doesn't exist!${reset}"
104+
print_brake 26
105+
echo
106+
exit 1
107+
fi
108+
}
109+
72110

73111
#### Install Dependencies ####
74112

@@ -80,7 +118,7 @@ print_brake 30
80118
echo
81119
case "$OS" in
82120
debian | ubuntu)
83-
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && apt-get install -y zip
121+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs && sudo apt-get install -y zip
84122
;;
85123
esac
86124

@@ -165,6 +203,7 @@ print_brake 50
165203

166204
#### Exec Script ####
167205
check_distro
206+
compatibility
168207
dependencies
169208
backup
170209
download_files

0 commit comments

Comments
 (0)