33 lines
849 B
Bash
33 lines
849 B
Bash
#!/bin/sh
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
set -e
|
|
case "$1" in
|
|
configure)
|
|
chmod 600 /usr/share/OGAgent/cfg/ogagent.cfg
|
|
# Instalar filebeat directamente desde el paquete incluido
|
|
if [ -f /usr/share/OGAgent/filebeat/filebeat-oss-7.12.1-amd64.deb ]; then
|
|
echo "TRYING INSTALLING FILEBEAT"
|
|
# Crear un servicio temporal con un retraso de 30 segundos
|
|
systemd-run --quiet --unit=install-filebeat \
|
|
--on-active=30s \
|
|
/usr/share/OGAgent/filebeat/install_filebeat.sh
|
|
else
|
|
echo "Advertencia: El paquete filebeat no se encuentra en /usr/share/OGAgent/" >&2
|
|
fi
|
|
|
|
;;
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
;;
|
|
|
|
*)
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|