1
0
mirror of https://github.com/tommytran732/Pterodactyl-Script synced 2024-11-09 05:01:33 -05: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 if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
systemctl enable redis-server systemctl enable redis-server
service redis-server start service redis-server start
systemctl enable php8.0-fpm systemctl enable --now php8.0-fpm
service php8.0-fpm start
elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ]; then elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ]; then
systemctl enable --now redis systemctl enable --now redis
systemctl enable --now php-fpm systemctl enable --now php-fpm
@ -689,8 +688,8 @@ install_wings() {
output "Installing Docker" output "Installing Docker"
if [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ]; then 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 install podman-docker
dnf -y install docker-ce systemctl enable --now podman.socket
else else
curl -sSL https://get.docker.com/ | CHANNEL=stable bash curl -sSL https://get.docker.com/ | CHANNEL=stable bash
fi fi
@ -784,7 +783,7 @@ ssl_certs(){
if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then if [ "$lsb_dist" = "ubuntu" ] || [ "$lsb_dist" = "debian" ]; then
apt-get -y install certbot apt-get -y install certbot
elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ]; then elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ] || [ "$lsb_dist" = "rocky" ]; then
yum -y install certbot dnf -y install certbot
fi fi
service nginx stop service nginx stop
certbot certonly --standalone --email "$email" --agree-tos -d "$FQDN" --non-interactive certbot certonly --standalone --email "$email" --agree-tos -d "$FQDN" --non-interactive
@ -799,24 +798,6 @@ ssl_certs(){
else else
service nginx restart service nginx restart
fi 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(){ firewall(){
@ -938,40 +919,40 @@ broadcast_database(){
preflight preflight
install_options install_options
case $installoption in case $installoption in
1) repositories_setup 1) repositories_setup
required_infos required_infos
firewall firewall
setup_pterodactyl setup_pterodactyl
broadcast broadcast
broadcast_database broadcast_database
;; ;;
2) repositories_setup 2) repositories_setup
required_infos required_infos
firewall firewall
ssl_certs ssl_certs
install_wings install_wings
broadcast broadcast
broadcast_database broadcast_database
;; ;;
3) repositories_setup 3) repositories_setup
required_infos required_infos
firewall firewall
ssl_certs ssl_certs
setup_pterodactyl setup_pterodactyl
install_wings install_wings
broadcast broadcast
;; ;;
4) upgrade_pterodactyl 4) upgrade_pterodactyl
;; ;;
5) upgrade_wings 5) upgrade_wings
;; ;;
6) upgrade_pterodactyl 6) upgrade_pterodactyl
upgrade_wings upgrade_wings
;; ;;
7) install_phpmyadmin 7) install_phpmyadmin
;; ;;
8) curl -sSL https://raw.githubusercontent.com/tommytran732/MariaDB-Root-Password-Reset/master/mariadb-104.sh | sudo bash 8) curl -sSL https://raw.githubusercontent.com/tommytran732/MariaDB-Root-Password-Reset/master/mariadb-104.sh | sudo bash
;; ;;
9) database_host_reset 9) database_host_reset
;; ;;
esac esac