1
0
mirror of https://github.com/tommytran732/Pterodactyl-Script synced 2024-11-22 10:31:34 -05:00

Update install.sh

This commit is contained in:
Tommy 2021-11-02 02:03:07 -04:00 committed by GitHub
parent cfbd78dc85
commit 2fb77607ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -720,14 +720,18 @@ upgrade_wings(){
install_phpmyadmin(){ install_phpmyadmin(){
output "Installing phpMyAdmin..." output "Installing phpMyAdmin..."
cd /var/www/pterodactyl/public || exit if [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ] || [ "$lsb_dist" != "almalinux" ]; then
rm -rf phpmyadmin dnf -y install phpmyadmin
wget https://files.phpmyadmin.net/phpMyAdmin/${PHPMYADMIN}/phpMyAdmin-${PHPMYADMIN}-all-languages.zip ln -s /usr/share/phpMyAdmin /var/www/pterodactyl/public
unzip phpMyAdmin-${PHPMYADMIN}-all-languages.zip else
mv phpMyAdmin-${PHPMYADMIN}-all-languages phpmyadmin cd /var/www/pterodactyl/public || exit
rm -rf phpMyAdmin-${PHPMYADMIN}-all-languages.zip rm -rf phpmyadmin
wget https://files.phpmyadmin.net/phpMyAdmin/${PHPMYADMIN}/phpMyAdmin-${PHPMYADMIN}-all-languages.zip
unzip phpMyAdmin-${PHPMYADMIN}-all-languages.zip
mv phpMyAdmin-${PHPMYADMIN}-all-languages phpmyadmin
rm -rf phpMyAdmin-${PHPMYADMIN}-all-languages.zip
fi
cd /var/www/pterodactyl/public/phpmyadmin || exit cd /var/www/pterodactyl/public/phpmyadmin || exit
SERVER_IP=$(dig +short myip.opendns.com @resolver1.opendns.com) SERVER_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
BOWFISH=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 34 | head -n 1` BOWFISH=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 34 | head -n 1`
bash -c 'cat > /var/www/pterodactyl/public/phpmyadmin/config.inc.php' <<EOF bash -c 'cat > /var/www/pterodactyl/public/phpmyadmin/config.inc.php' <<EOF
@ -790,7 +794,7 @@ firewall(){
output "Setting up Fail2Ban..." output "Setting up Fail2Ban..."
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
apt -y install fail2ban apt -y install fail2ban
elif [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ] || [ "$lsb_dist" != "almalinux" ]; then elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ] || [ "$lsb_dist" != "almalinux" ]; then
dnf -y install fail2ban dnf -y install fail2ban
fi fi
systemctl enable fail2ban systemctl enable fail2ban
@ -825,7 +829,7 @@ EOF
ufw allow 3306 ufw allow 3306
fi fi
yes | ufw enable yes | ufw enable
elif [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ] || [ "$lsb_dist" != "almalinux" ]; then elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ] || [ "$lsb_dist" != "almalinux" ]; then
dnf -y install firewalld dnf -y install firewalld
systemctl enable firewalld systemctl enable firewalld
systemctl start firewalld systemctl start firewalld