Update phpmyadmin.sh
This commit is contained in:
parent
d009f90945
commit
eb48c4b882
@ -130,7 +130,7 @@ function configure_phpmyadmin() {
|
|||||||
systemctl restart apache2
|
systemctl restart apache2
|
||||||
msg_ok "Configured phpMyAdmin with Apache"
|
msg_ok "Configured phpMyAdmin with Apache"
|
||||||
else
|
else
|
||||||
msg_info "Configuring Nginx for phpMyAdmin"
|
msg_info "Configuring Nginx for phpMyAdmin (Alpine detected)"
|
||||||
|
|
||||||
mkdir -p /etc/nginx/http.d
|
mkdir -p /etc/nginx/http.d
|
||||||
cat <<EOF >/etc/nginx/http.d/phpmyadmin.conf
|
cat <<EOF >/etc/nginx/http.d/phpmyadmin.conf
|
||||||
@ -153,15 +153,23 @@ server {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if ! pgrep -x "nginx" >/dev/null; then
|
msg_info "Testing Nginx configuration"
|
||||||
|
if nginx -t; then
|
||||||
|
if ! pgrep -x "nginx" > /dev/null; then
|
||||||
msg_info "Starting Nginx"
|
msg_info "Starting Nginx"
|
||||||
rc-service nginx start
|
rc-service nginx start
|
||||||
else
|
else
|
||||||
msg_info "Reloading Nginx"
|
msg_info "Reloading Nginx"
|
||||||
rc-service nginx reload
|
rc-service nginx reload
|
||||||
fi
|
fi
|
||||||
msg_ok "Configured phpMyAdmin with Nginx"
|
msg_ok "Configured and started Nginx successfully"
|
||||||
|
else
|
||||||
|
msg_error "Nginx configuration test failed. Please fix before starting nginx."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function uninstall_phpmyadmin() {
|
function uninstall_phpmyadmin() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user