Skip to content

Commit c7d937d

Browse files
committed
Update NodeJS
1 parent 8fc0a4b commit c7d937d

File tree

7 files changed

+44
-59
lines changed

7 files changed

+44
-59
lines changed

install.sh

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ curl --silent \
2323

2424
SCRIPT_VERSION="$(get_release)"
2525

26-
26+
# Visual Functions #
2727
print_brake() {
2828
for ((n = 0; n < $1; n++)); do
2929
echo -n "#"
@@ -35,31 +35,22 @@ hyperlink() {
3535
echo -e "\e]8;;${1}\a${1}\e]8;;\a"
3636
}
3737

38-
#### Colors ####
39-
40-
reset="\e[0m"
41-
red='\033[0;31m'
38+
RESET="\e[0m"
39+
RED='\033[0;31m'
4240

4341
error() {
44-
red='\033[0;31m'
45-
reset="\e[0m"
46-
4742
echo ""
48-
echo -e "* ${red}ERROR${reset}: $1"
43+
echo -e "* ${RED}ERROR${RESET}: $1"
4944
echo ""
5045
}
5146

52-
53-
#### Check Sudo ####
54-
47+
# Check Sudo #
5548
if [[ $EUID -ne 0 ]]; then
5649
echo "* This script must be executed with root privileges (sudo)." 1>&2
5750
exit 1
5851
fi
5952

60-
61-
#### Check Curl ####
62-
53+
# Check Curl #
6354
if ! [ -x "$(command -v curl)" ]; then
6455
echo "* curl is required in order for this script to work."
6556
echo "* install using apt (Debian and derivatives) or yum/dnf (CentOS)"
@@ -68,7 +59,7 @@ fi
6859

6960
cancel() {
7061
echo
71-
echo -e "* ${red}Installation Canceled!${reset}"
62+
echo -e "* ${RED}Installation Canceled!${RESET}"
7263
done=true
7364
exit 1
7465
}
@@ -87,31 +78,31 @@ print_brake 70
8778
echo
8879

8980
Backup() {
90-
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION}/backup.sh)
81+
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/"${SCRIPT_VERSION}"/backup.sh)
9182
}
9283

9384
Dracula() {
94-
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION}/themes/version1.x/Dracula/build.sh)
85+
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/"${SCRIPT_VERSION}"/themes/version1.x/Dracula/build.sh)
9586
}
9687

9788
Enola() {
98-
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION}/themes/version1.x/Enola/build.sh)
89+
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/"${SCRIPT_VERSION}"/themes/version1.x/Enola/build.sh)
9990
}
10091

10192
Twilight() {
102-
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION}/themes/version1.x/Twilight/build.sh)
93+
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/"${SCRIPT_VERSION}"/themes/version1.x/Twilight/build.sh)
10394
}
10495

10596
ZingTheme() {
106-
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION}/themes/version1.x/ZingTheme/build.sh)
97+
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/"${SCRIPT_VERSION}"/themes/version1.x/ZingTheme/build.sh)
10798
}
10899

109100
FlancoTheme() {
110-
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION}/themes/version1.x/FlancoTheme/build.sh)
101+
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/"${SCRIPT_VERSION}"/themes/version1.x/FlancoTheme/build.sh)
111102
}
112103

113104
BackgroundVideo() {
114-
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/${SCRIPT_VERSION}/themes/version1.x/BackgroundVideo/build.sh)
105+
bash <(curl -s https://raw.githubusercontent.com/Ferks-FK/Pterodactyl-AutoThemes/"${SCRIPT_VERSION}"/themes/version1.x/BackgroundVideo/build.sh)
115106
}
116107

117108

themes/version1.x/BackgroundVideo/build.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
# shellcheck disable=SC2002
32
# shellcheck source=/dev/null
43

54
set -e
@@ -31,11 +30,12 @@ INFORMATIONS="/var/log/Pterodactyl-AutoThemes-informations"
3130
# Update Variables #
3231
update_variables() {
3332
CONFIG_FILE="$PTERO/config/app.php"
34-
PANEL_VERSION="$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")"
33+
PANEL_VERSION="$(grep "'version'" "$CONFIG_FILE" | cut -c18-25 | sed "s/[',]//g")"
3534
VIDEO_FILE="$(cd "$PTERO/public" && find . -iname '*.mp4' | tail -1 | sed "s/.\///g")"
3635
ZING="$PTERO/resources/scripts/components/SidePanel.tsx"
3736
}
3837

38+
# Visual Functions #
3939
print_brake() {
4040
for ((n = 0; n < $1; n++)); do
4141
echo -n "#"
@@ -65,7 +65,6 @@ hyperlink() {
6565
echo -e "\e]8;;${1}\a${1}\e]8;;\a"
6666
}
6767

68-
# Colors #
6968
GREEN="\e[0;92m"
7069
YELLOW="\033[1;33m"
7170
RED='\033[0;31m'
@@ -142,11 +141,11 @@ print "Installing dependencies..."
142141

143142
case "$OS" in
144143
debian | ubuntu)
145-
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
144+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs
146145
;;
147146
centos)
148-
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
149-
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
147+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo yum install -y nodejs yarn
148+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo dnf install -y nodejs
150149
;;
151150
esac
152151
}

themes/version1.x/Dracula/build.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
# shellcheck disable=SC2002
32
# shellcheck source=/dev/null
43

54
set -e
@@ -30,9 +29,10 @@ SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
3029
# Update Variables #
3130
update_variables() {
3231
CONFIG_FILE="$PTERO/config/app.php"
33-
PANEL_VERSION=$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
32+
PANEL_VERSION="$(grep "'version'" "$CONFIG_FILE" | cut -c18-25 | sed "s/[',]//g")"
3433
}
3534

35+
# Visual Functions #
3636
print_brake() {
3737
for ((n = 0; n < $1; n++)); do
3838
echo -n "#"
@@ -62,7 +62,6 @@ hyperlink() {
6262
echo -e "\e]8;;${1}\a${1}\e]8;;\a"
6363
}
6464

65-
# Colors #
6665
GREEN="\e[0;92m"
6766
YELLOW="\033[1;33m"
6867
RED='\033[0;31m'
@@ -140,11 +139,11 @@ print "Installing dependencies..."
140139

141140
case "$OS" in
142141
debian | ubuntu)
143-
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
142+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs
144143
;;
145144
centos)
146-
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
147-
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
145+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo yum install -y nodejs yarn
146+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo dnf install -y nodejs
148147
;;
149148
esac
150149
}

themes/version1.x/Enola/build.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
# shellcheck disable=SC2002
32
# shellcheck source=/dev/null
43

54
set -e
@@ -30,9 +29,10 @@ SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
3029
# Update Variables #
3130
update_variables() {
3231
CONFIG_FILE="$PTERO/config/app.php"
33-
PANEL_VERSION=$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
32+
PANEL_VERSION="$(grep "'version'" "$CONFIG_FILE" | cut -c18-25 | sed "s/[',]//g")"
3433
}
3534

35+
# Visual Functions #
3636
print_brake() {
3737
for ((n = 0; n < $1; n++)); do
3838
echo -n "#"
@@ -62,7 +62,6 @@ hyperlink() {
6262
echo -e "\e]8;;${1}\a${1}\e]8;;\a"
6363
}
6464

65-
# Colors #
6665
GREEN="\e[0;92m"
6766
YELLOW="\033[1;33m"
6867
RED='\033[0;31m'
@@ -139,11 +138,11 @@ print "Installing dependencies..."
139138

140139
case "$OS" in
141140
debian | ubuntu)
142-
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
141+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs
143142
;;
144143
centos)
145-
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
146-
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
144+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo yum install -y nodejs yarn
145+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo dnf install -y nodejs
147146
;;
148147
esac
149148
}

themes/version1.x/FlancoTheme/build.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
# shellcheck disable=SC2002
32
# shellcheck source=/dev/null
43

54
set -e
@@ -30,9 +29,10 @@ SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
3029
# Update Variables #
3130
update_variables() {
3231
CONFIG_FILE="$PTERO/config/app.php"
33-
PANEL_VERSION=$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
32+
PANEL_VERSION="$(grep "'version'" "$CONFIG_FILE" | cut -c18-25 | sed "s/[',]//g")"
3433
}
3534

35+
# Visual Functions #
3636
print_brake() {
3737
for ((n = 0; n < $1; n++)); do
3838
echo -n "#"
@@ -62,7 +62,6 @@ hyperlink() {
6262
echo -e "\e]8;;${1}\a${1}\e]8;;\a"
6363
}
6464

65-
# Colors #
6665
GREEN="\e[0;92m"
6766
YELLOW="\033[1;33m"
6867
RED='\033[0;31m'
@@ -139,11 +138,11 @@ print "Installing dependencies..."
139138

140139
case "$OS" in
141140
debian | ubuntu)
142-
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
141+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs
143142
;;
144143
centos)
145-
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
146-
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
144+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo yum install -y nodejs yarn
145+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo dnf install -y nodejs
147146
;;
148147
esac
149148
}

themes/version1.x/Twilight/build.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
# shellcheck disable=SC2002
32
# shellcheck source=/dev/null
43

54
set -e
@@ -30,9 +29,10 @@ SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
3029
# Update Variables #
3130
update_variables() {
3231
CONFIG_FILE="$PTERO/config/app.php"
33-
PANEL_VERSION=$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
32+
PANEL_VERSION="$(grep "'version'" "$CONFIG_FILE" | cut -c18-25 | sed "s/[',]//g")"
3433
}
3534

35+
# Visual Functions #
3636
print_brake() {
3737
for ((n = 0; n < $1; n++)); do
3838
echo -n "#"
@@ -62,7 +62,6 @@ hyperlink() {
6262
echo -e "\e]8;;${1}\a${1}\e]8;;\a"
6363
}
6464

65-
# Colors #
6665
GREEN="\e[0;92m"
6766
YELLOW="\033[1;33m"
6867
RED='\033[0;31m'
@@ -139,11 +138,11 @@ print "Installing dependencies..."
139138

140139
case "$OS" in
141140
debian | ubuntu)
142-
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
141+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs
143142
;;
144143
centos)
145-
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
146-
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
144+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo yum install -y nodejs yarn
145+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo dnf install -y nodejs
147146
;;
148147
esac
149148
}

themes/version1.x/ZingTheme/build.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
# shellcheck disable=SC2002
32
# shellcheck source=/dev/null
43

54
set -e
@@ -31,9 +30,10 @@ SUPPORT_LINK="https://discord.gg/buDBbSGJmQ"
3130
update_variables() {
3231
ZING="$PTERO/resources/scripts/components/SidePanel.tsx"
3332
CONFIG_FILE="$PTERO/config/app.php"
34-
PANEL_VERSION=$(cat "$CONFIG_FILE" | grep -n ^ | grep ^12: | cut -d: -f2 | cut -c18-23 | sed "s/'//g")
33+
PANEL_VERSION="$(grep "'version'" "$CONFIG_FILE" | cut -c18-25 | sed "s/[',]//g")"
3534
}
3635

36+
# Visual Functions #
3737
print_brake() {
3838
for ((n = 0; n < $1; n++)); do
3939
echo -n "#"
@@ -63,7 +63,6 @@ hyperlink() {
6363
echo -e "\e]8;;${1}\a${1}\e]8;;\a"
6464
}
6565

66-
# Colors #
6766
GREEN="\e[0;92m"
6867
YELLOW="\033[1;33m"
6968
RED='\033[0;31m'
@@ -140,11 +139,11 @@ print "Installing dependencies..."
140139

141140
case "$OS" in
142141
debian | ubuntu)
143-
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt-get install -y nodejs
142+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - && apt-get install -y nodejs
144143
;;
145144
centos)
146-
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo yum install -y nodejs yarn
147-
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash - && sudo dnf install -y nodejs
145+
[ "$OS_VER_MAJOR" == "7" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo yum install -y nodejs yarn
146+
[ "$OS_VER_MAJOR" == "8" ] && curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash - && sudo dnf install -y nodejs
148147
;;
149148
esac
150149
}

0 commit comments

Comments
 (0)