1
0
mirror of https://github.com/tommytran732/Pterodactyl-Script synced 2024-09-16 14:14:42 -04:00
This commit is contained in:
Tommy 2021-10-23 03:31:34 -04:00
parent 40570e60bd
commit 0fd5bfc383

View File

@ -315,8 +315,7 @@ install_dependencies(){
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
systemctl enable redis-server
service redis-server start
systemctl enable php8.0-fpm
service php8.0-fpm start
systemctl enable --now php8.0-fpm
elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ]; then
systemctl enable --now redis
systemctl enable --now php-fpm
@ -689,8 +688,8 @@ install_wings() {
output "Installing Docker"
if [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ]; then
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf -y install docker-ce
dnf install podman-docker
systemctl enable --now podman.socket
else
curl -sSL https://get.docker.com/ | CHANNEL=stable bash
fi
@ -784,7 +783,7 @@ ssl_certs(){
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
apt-get -y install certbot
elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ]; then
yum -y install certbot
dnf -y install certbot
fi
service nginx stop
certbot certonly --standalone --email "$email" --agree-tos -d "$FQDN" --non-interactive
@ -799,24 +798,6 @@ ssl_certs(){
else
service nginx restart
fi
if [ "$lsb_dist" = "debian" ] || [ "$lsb_dist" = "ubuntu" ]; then
if [ "$installoption" = "1" ]; then
(crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service nginx stop" --post-hook "service nginx restart" >> /dev/null 2>&1')| crontab -
elif [ "$installoption" = "2" ]; then
(crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "ufw allow 80" --pre-hook "service wings stop" --post-hook "ufw deny 80" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab -
elif [ "$installoption" = "3" ]; then
(crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service nginx stop" --pre-hook "service wings stop" --post-hook "service nginx restart" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab -
fi
elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ]; then
if [ "$installoption" = "1" ]; then
(crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service nginx stop" --post-hook "service nginx restart" >> /dev/null 2>&1')| crontab -
elif [ "$installoption" = "2" ]; then
(crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "firewall-cmd --add-port=80/tcp && firewall-cmd --reload" --pre-hook "service wings stop" --post-hook "firewall-cmd --remove-port=80/tcp && firewall-cmd --reload" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab -
elif [ "$installoption" = "3" ]; then
(crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service nginx stop" --pre-hook "service wings stop" --post-hook "service nginx restart" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab -
fi
fi
}
firewall(){
@ -938,40 +919,40 @@ broadcast_database(){
preflight
install_options
case $installoption in
1) repositories_setup
required_infos
firewall
setup_pterodactyl
broadcast
1) repositories_setup
required_infos
firewall
setup_pterodactyl
broadcast
broadcast_database
;;
2) repositories_setup
required_infos
firewall
ssl_certs
install_wings
broadcast
;;
2) repositories_setup
required_infos
firewall
ssl_certs
install_wings
broadcast
broadcast_database
;;
3) repositories_setup
required_infos
firewall
ssl_certs
setup_pterodactyl
install_wings
broadcast
;;
4) upgrade_pterodactyl
;;
5) upgrade_wings
;;
;;
3) repositories_setup
required_infos
firewall
ssl_certs
setup_pterodactyl
install_wings
broadcast
;;
4) upgrade_pterodactyl
;;
5) upgrade_wings
;;
6) upgrade_pterodactyl
upgrade_wings
;;
7) install_phpmyadmin
;;
8) curl -sSL https://raw.githubusercontent.com/tommytran732/MariaDB-Root-Password-Reset/master/mariadb-104.sh | sudo bash
;;
9) database_host_reset
;;
7) install_phpmyadmin
;;
8) curl -sSL https://raw.githubusercontent.com/tommytran732/MariaDB-Root-Password-Reset/master/mariadb-104.sh | sudo bash
;;
9) database_host_reset
;;
esac