refs #981 Adds correctly the config file and adds a apt -get update before install any packages
testing/og-dhcp-API/pipeline/head There was a failure building this commit Details

nginx_conf
Qindel 2024-10-18 11:21:49 +00:00
parent 2946fc1d19
commit 9ea652070c
1 changed files with 19 additions and 4 deletions

View File

@ -11,6 +11,12 @@ function globalSetup() {
PROGRAMDIR=$(readlink -e "$current_dir")
PROGRAMNAME=$(basename "$0")
OPENGNSYS_CLIENT_USER="ogdhcp"
current_dir=$(dirname "$0")
PROGRAMDIR=$(readlink -e "$current_dir")
# Ruta del archivo config_ogdhcp.json proporcionado por el usuario
CONFIG_FILE="$PROGRAMDIR/config_ogdhcp.json"
# Comprobar si se ha descargado el paquete comprimido (REMOTE=0) o sólo el instalador (REMOTE=1).
if [ -d "$PROGRAMDIR/../installer" ]; then
@ -85,12 +91,12 @@ function checkDependencies() {
)
export DEBIAN_FRONTEND=noninteractive
apt-get update -y
# Comprobar cada dependencia
for dep in "${DEPENDENCIES[@]}"; do
if ! dpkg -s "$dep" >/dev/null 2>&1; then
echoAndLog "$dep is not installed. Installing..."
sudo apt-get install -y --no-install-recommends "$dep"
apt-get install -y --no-install-recommends "$dep"
else
echoAndLog "$dep is already installed."
fi
@ -451,8 +457,6 @@ modify_php_fpm_config() {
configure_kea() {
# Ruta del archivo config_ogdhcp.json proporcionado por el usuario
CONFIG_FILE="config_ogdhcp.json"
# Verificar si jq está instalado
if ! command -v jq &> /dev/null; then
@ -513,6 +517,17 @@ configure_kea() {
EOL
echo "Se ha generado la configuración mínima de Kea DHCP en $KEA_CONFIG"
# Reiniciar el servicio de Kea DHCP y verificar si se reinicia correctamente
echo "Reiniciando el servicio Kea DHCP..."
sudo systemctl restart kea-dhcp4-server.service
# Comprobar el estado del servicio Kea DHCP
if systemctl is-active --quiet kea-dhcp4-server.service; then
echo "Kea DHCP reiniciado correctamente."
else
echo "Error al reiniciar Kea DHCP."
exit 1
fi
}