Updated pre and post files
testing/ogGui-multibranch/pipeline/head Something is wrong with the build of this commit Details
oggui-debian-package/pipeline/tag This commit looks good Details
oggui-debian-package/pipeline/head This commit looks good Details

pull/20/head^2 0.11.0
Nicolas Arenas 2025-04-11 13:44:29 +02:00
parent b2d34a6880
commit 2b3f7b6e34
3 changed files with 6 additions and 22 deletions

View File

@ -1,7 +1,6 @@
#!/bin/bash
set -e
set -x
. /usr/share/debconf/confmodule
@ -12,14 +11,14 @@ OGMERCURE_URL="$RET"
# Asegurarse de que el usuario exista
USER="opengnsys"
HASH_FILE="/opt/opengnsys/oggui/var/lib/oggui/oggui.config.hash"
CONFIG_FILE="/opt/opengnsys/oggui/browser/assets/config.json"
# Detectar si es una instalación nueva o una actualización
if [ "$1" = "configure" ] && [ -z "$2" ]; then
jq --arg apiUrl "$OGCORE_URL" --arg mercureUrl "$OGMERCURE_URL" \
'.apiUrl = $apiUrl | .mercureUrl = $mercureUrl' "$CONFIG_FILE" > "${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"
ln -s /opt/opengnsys/oggui/etc/systemd/system/oggui.service /etc/systemd/system/oggui.service
if [ ! -f "$CONFIG_FILE" ]; then
jq --arg apiUrl "$OGCORE_URL" --arg mercureUrl "$OGMERCURE_URL" \
'.apiUrl = $apiUrl | .mercureUrl = $mercureUrl' "$CONFIG_FILE" > "${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"
fi
ln -s /opt/opengnsys/oggui/etc/nginx/oggui.conf /etc/nginx/sites-enabled/oggui.conf
ln -s $CONFIG_FILE /opt/opengnsys/oggui/etc/config.json
mkdir -p /etc/nginx/certs/

5
debian/oggui.prerm vendored
View File

@ -3,9 +3,8 @@
set -e
set -x
if [ "$1" = "upgrade" ]; then
# Eliminar enlaces simbólicos creados en postinst
rm -f /etc/systemd/system/oggui.service
# Solo eliminar archivos de configuración si se está eliminando el paquete
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
rm -f /etc/nginx/sites-enabled/oggui.conf
systemctl daemon-reload
systemctl restart nginx

View File

@ -1,14 +0,0 @@
[Unit]
Description=Aplicación Angular con Nginx
After=network.target
[Service]
Type=simple
ExecStart=/opt/opengnsys/oggui/bin/start-oggui.sh
Restart=always
User=www-data
WorkingDirectory=/var/www/mi-aplicacion
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target