forked from Angelillo15/MinecraftPurpleTheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
90 lines (77 loc) · 2.13 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
if (( $EUID != 0 )); then
echo "Please run as root"
exit
fi
clear
installTheme(){
cd /var/www/
tar -cvf MinecraftPurpleThemebackup.tar.gz pterodactyl
echo "Installing theme..."
cd /var/www/pterodactyl
rm -r MinecraftPurpleTheme
git clone https://github.com/Angelillo15/MinecraftPurpleTheme.git
cd MinecraftPurpleTheme
rm /var/www/pterodactyl/resources/scripts/MinecraftPurpleTheme.css
rm /var/www/pterodactyl/resources/scripts/index.tsx
mv index.tsx /var/www/pterodactyl/resources/scripts/index.tsx
mv MinecraftPurpleTheme.css /var/www/pterodactyl/resources/scripts/MinecraftPurpleTheme.css
cd /var/www/pterodactyl
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
apt update
apt install -y nodejs
npm i -g yarn
yarn
cd /var/www/pterodactyl
yarn build:production
sudo php artisan optimize:clear
}
installThemeQuestion(){
while true; do
read -p "Are you sure that you want to install the theme [y/n]? " yn
case $yn in
[Yy]* ) installTheme; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
}
repair(){
bash <(curl https://raw.githubusercontent.com/Angelillo15/MinecraftPurpleTheme/main/repair.sh)
}
restoreBackUp(){
echo "Restoring backup..."
cd /var/www/
tar -xvf MinecraftPurpleThemebackup.tar.gz
rm MinecraftPurpleThemebackup.tar.gz
cd /var/www/pterodactyl
yarn build:production
sudo php artisan optimize:clear
}
echo "Copyright (c) 2022 Angelillo15 | angelillo15.es"
echo "This program is free software: you can redistribute it and/or modify"
echo ""
echo "Discord: https://discord.angelillo15.es/"
echo "Website: https://angelillo15.es/"
echo ""
echo "[1] Install theme"
echo "[2] Restore backup"
echo "[3] Repair panel (use if you have an error in the theme installation)"
echo "[4] Exit"
read -p "Please enter a number: " choice
if [ $choice == "1" ]
then
installThemeQuestion
fi
if [ $choice == "2" ]
then
restoreBackUp
fi
if [ $choice == "3" ]
then
repair
fi
if [ $choice == "4" ]
then
exit
fi