diff --git a/etc/nginxServer.conf.tmpl b/etc/nginxServer.conf.tmpl index b67abda..e4f60ac 100644 --- a/etc/nginxServer.conf.tmpl +++ b/etc/nginxServer.conf.tmpl @@ -3,7 +3,7 @@ server { server_name __SERVERIP__ localhost; # IP del servidor # Raíz del documento para el proyecto Symfony - root /opt/ogdhcp/public; + root __PUBLICDIR__; # Bloque para manejar las solicitudes a /ogdhcp location /ogdhcp { diff --git a/installer/ogdhcp_installer.sh b/installer/ogdhcp_installer.sh index 3691df9..6780301 100755 --- a/installer/ogdhcp_installer.sh +++ b/installer/ogdhcp_installer.sh @@ -373,7 +373,8 @@ add_write_permission_apparmor() { # Función para configurar Nginx setup_nginx() { - + local path_opengnsys_base="$1" + local public_dir="$path_opengnsys_base/public" #ip_address_server=$(get_ip_address "$DEFAULTDEV") if [[ ! -f "$CONFIG_FILE" ]]; then echo "Error: El archivo de configuración no se encontró." @@ -398,10 +399,11 @@ setup_nginx() { echo "Error: La plantilla de Nginx no se encontró." exit 1 fi - + nginx_content=$(<"$NGINX_TEMPLATE") nginx_content="${nginx_content//__SERVERIP__/$ip_address_server}" nginx_content="${nginx_content//__PHPVERSION__/$php_version}" + nginx_content="${nginx_content//__PUBLICDIR__/$public_dir}" # Crear el archivo de configuración de Nginx echo "$nginx_content" > "$NGINX_OUTPUT" diff --git a/src/DhcpBundle/Controller/DhcpController.php b/src/DhcpBundle/Controller/DhcpController.php index 2d7ed3e..9c7d759 100644 --- a/src/DhcpBundle/Controller/DhcpController.php +++ b/src/DhcpBundle/Controller/DhcpController.php @@ -98,7 +98,7 @@ class DhcpController private function getDiskUsage(): array { // Simular la salida del comando df para obtener el uso del disco - $output = shell_exec("df -h /opt/ogdhcp | tail -1 | awk '{print $2, $3, $4, $5}'"); + $output = shell_exec("df -h " . realpath($this->backup_dir) . " | tail -1 | awk '{print $2, $3, $4, $5}'"); if (!$output) { $this->logger->error("Failed to execute disk usage command"); return null;