diff --git a/debian/ogboot.postinst b/debian/ogboot.postinst index efb12ef..042031a 100755 --- a/debian/ogboot.postinst +++ b/debian/ogboot.postinst @@ -145,8 +145,6 @@ configure_nginx_and_fpm() { configure_samba(){ echo "Configurando Samba" - dpkg-divert --package ogboot --add --rename --divert /etc/samba/smb.conf.orig /etc/samba/smb.conf - cp /etc/samba/smb.conf.orig /etc/samba/smb.conf mkdir -p /etc/samba/opengsys/ cp /opt/opengnsys/ogboot/etc/samba/smb-ogboot.conf /etc/samba/opengsys/ sed -i "s|__OGBOOT_DIR__|$OGBOOT_DIR|g" /etc/samba/opengsys/smb-ogboot.conf diff --git a/debian/ogboot.postrm b/debian/ogboot.postrm index 5981356..354dc1e 100644 --- a/debian/ogboot.postrm +++ b/debian/ogboot.postrm @@ -15,4 +15,10 @@ if [ "$1" = "remove" ]; then # Eliminar la desviación dpkg-divert --remove --rename "$CONFIG_FILE" + # Eliminar la linea de inclusión de samba en smb.conf si existe + INCLUDE_LINE="include = /etc/samba/opengnsys/smb_ogboot.conf" + if grep -q "$INCLUDE_LINE" /etc/samba/smb.conf; then + sed -i "/$INCLUDE_LINE/d" /etc/samba/smb.conf + fi + fi