2022-12-16 17:47:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
BLUE='\033[0;34m'.
|
|
|
|
NO_COLOR='\033[0m'
|
|
|
|
|
|
|
|
if (( $EUID != 0 )); then
|
|
|
|
echo "Please run as root"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
installTheme(){
|
|
|
|
cd /var/www/
|
|
|
|
tar -cvf IceMinecraftTheme.tar.gz pterodactyl
|
|
|
|
echo "Installing theme..."
|
|
|
|
cd /var/www/pterodactyl
|
|
|
|
rm -r IceMinecraftTheme
|
|
|
|
git clone https://github.com/Angelillo15/IceMinecraftTheme.git
|
2022-12-16 17:53:25 +00:00
|
|
|
cd IceMinecraftTheme
|
2022-12-16 17:47:24 +00:00
|
|
|
rm /var/www/pterodactyl/resources/scripts/IceMinecraftTheme.css
|
|
|
|
rm /var/www/pterodactyl/resources/scripts/index.tsx
|
|
|
|
rm /var/www/pterodactyl/resources/scripts/components/server/console/Console.tsx
|
2022-12-16 17:57:48 +00:00
|
|
|
mv resources/scripts/index.tsx /var/www/pterodactyl/resources/scripts/index.tsx
|
2022-12-16 17:49:53 +00:00
|
|
|
mv resources/scripts/IceMinecraftTheme.css /var/www/pterodactyl/resources/scripts/IceMinecraftTheme.css
|
2022-12-16 17:55:13 +00:00
|
|
|
mv resources/scripts/components/server/console/Console.tsx /var/www/pterodactyl/resources/scripts/components/server/console/Console.tsx
|
2022-12-16 17:47:24 +00:00
|
|
|
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;;
|
|
|
|
* ) exit;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
repair(){
|
|
|
|
bash <(curl https://raw.githubusercontent.com/Angelillo15/IceMinecraftTheme/main/repair.sh)
|
|
|
|
}
|
|
|
|
|
|
|
|
restoreBackUp(){
|
|
|
|
echo "Restoring backup..."
|
|
|
|
cd /var/www/
|
|
|
|
tar -xvf IceMinecraftTheme.tar.gz
|
|
|
|
rm IceMinecraftTheme.tar.gz
|
|
|
|
|
|
|
|
cd /var/www/pterodactyl
|
|
|
|
yarn build:production
|
|
|
|
sudo php artisan optimize:clear
|
|
|
|
}
|
|
|
|
|
|
|
|
printf "${blue} ____ _____ ______ _________________ ____ ____ ______ ______ _______ ______ \n"
|
|
|
|
printf "${blue}| | ___|\ \ ___|\ \ / \| | | | ___|\ \ | \/ \ ___|\ \ \n"
|
|
|
|
printf "${blue}| | / /\ \ | \ \ \______ ______/| | | || \ \ / /\ \ | \ \ \n"
|
|
|
|
printf "${blue}| || | | || ,_____/| \( / / )/ | |_| || ,_____/| / /\ / /\ || ,_____/| \n"
|
|
|
|
printf "${blue}| || | |____|| \--'\_|/ ' | | ' | .-. || \--'\_|/ / /\ \_/ / / /|| \--'\_|/ \n"
|
|
|
|
printf "${blue}| || | ____ | /___/| | | | | | || /___/| | | \|_|/ / / || /___/| \n"
|
|
|
|
printf "${blue}| || | | || \____|\ / // | | | || \____|\ | | | | || \____|\ \n"
|
|
|
|
printf "${blue}|____||\ ___\/ /||____ ' /| /___// |____| |____||____ ' /||\____\ |____| /|____ ' /| \n"
|
|
|
|
printf "${blue}| || | /____/ || /_____/ | | | | | | || /_____/ || | | | | / | /_____/ | \n"
|
|
|
|
printf "${blue}|____| \|___| | /|____| | / |____| |____| |____||____| | / \|____| |____|/ |____| | / \n"
|
|
|
|
printf "${blue} \( \( |____|/ \( |_____|/ \( \( )/ \( |_____|/ \( )/ \( |_____|/ \n"
|
|
|
|
printf "${blue} ' ' )/ ' )/ ' ' ' ' )/ ' ' ' )/ \n"
|
|
|
|
printf "${blue} ' ' ' ' \n"
|
|
|
|
echo ""
|
|
|
|
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)"
|
2022-12-16 17:53:25 +00:00
|
|
|
echo "[4] Update the panel"
|
|
|
|
echo "[5] Exit"
|
2022-12-16 17:47:24 +00:00
|
|
|
printf "${NO_COLOR}"
|
|
|
|
|
|
|
|
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" ]
|
2022-12-16 17:53:25 +00:00
|
|
|
then
|
|
|
|
repair
|
|
|
|
fi
|
|
|
|
if [ $choice == "5" ]
|
2022-12-16 17:47:24 +00:00
|
|
|
then
|
|
|
|
exit
|
2022-12-16 17:53:25 +00:00
|
|
|
fi
|