Files
Kelx/privileged/jobs/phpmyadmin-prepare.sh
2026-11-30 16:32:37 +00:00

14 lines
610 B
Bash

#!/usr/bin/env bash
# ADPanel privileged job: prepare the phpMyAdmin backend (PHP-FPM + nginx).
# Invoked via adpanel-priv: adpanel-priv job phpmyadmin-prepare
set -u
PHP_FPM_SVC=$(systemctl list-unit-files --type=service --no-legend | awk '{print $1}' | grep -E '^php[0-9.]+-fpm\.service$' | sort -rV | head -1)
if [ -n "$PHP_FPM_SVC" ]; then
systemctl enable "$PHP_FPM_SVC" 2>/dev/null || true
systemctl restart "$PHP_FPM_SVC" 2>/dev/null || true
fi
systemctl start nginx 2>/dev/null || true
nginx -t >/dev/null 2>&1 && systemctl reload nginx 2>/dev/null || systemctl restart nginx 2>/dev/null || true