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
testing/og-dhcp-API/pipeline/head There was a failure building this commit
Details
parent
2946fc1d19
commit
9ea652070c
|
@ -11,6 +11,12 @@ function globalSetup() {
|
||||||
PROGRAMDIR=$(readlink -e "$current_dir")
|
PROGRAMDIR=$(readlink -e "$current_dir")
|
||||||
PROGRAMNAME=$(basename "$0")
|
PROGRAMNAME=$(basename "$0")
|
||||||
OPENGNSYS_CLIENT_USER="ogdhcp"
|
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).
|
# Comprobar si se ha descargado el paquete comprimido (REMOTE=0) o sólo el instalador (REMOTE=1).
|
||||||
if [ -d "$PROGRAMDIR/../installer" ]; then
|
if [ -d "$PROGRAMDIR/../installer" ]; then
|
||||||
|
@ -85,12 +91,12 @@ function checkDependencies() {
|
||||||
|
|
||||||
)
|
)
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get update -y
|
||||||
# Comprobar cada dependencia
|
# Comprobar cada dependencia
|
||||||
for dep in "${DEPENDENCIES[@]}"; do
|
for dep in "${DEPENDENCIES[@]}"; do
|
||||||
if ! dpkg -s "$dep" >/dev/null 2>&1; then
|
if ! dpkg -s "$dep" >/dev/null 2>&1; then
|
||||||
echoAndLog "$dep is not installed. Installing..."
|
echoAndLog "$dep is not installed. Installing..."
|
||||||
sudo apt-get install -y --no-install-recommends "$dep"
|
apt-get install -y --no-install-recommends "$dep"
|
||||||
else
|
else
|
||||||
echoAndLog "$dep is already installed."
|
echoAndLog "$dep is already installed."
|
||||||
fi
|
fi
|
||||||
|
@ -451,8 +457,6 @@ modify_php_fpm_config() {
|
||||||
|
|
||||||
|
|
||||||
configure_kea() {
|
configure_kea() {
|
||||||
# Ruta del archivo config_ogdhcp.json proporcionado por el usuario
|
|
||||||
CONFIG_FILE="config_ogdhcp.json"
|
|
||||||
|
|
||||||
# Verificar si jq está instalado
|
# Verificar si jq está instalado
|
||||||
if ! command -v jq &> /dev/null; then
|
if ! command -v jq &> /dev/null; then
|
||||||
|
@ -513,6 +517,17 @@ configure_kea() {
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
echo "Se ha generado la configuración mínima de Kea DHCP en $KEA_CONFIG"
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue