Fixes permissions and samba configuration

pull/14/head
Nicolas Arenas 2025-03-26 19:24:12 +01:00
parent d748bb18d1
commit 42b5e7a827
2 changed files with 18 additions and 7 deletions

View File

@ -23,13 +23,7 @@ case "$1" in
cp -a "$OLD_FILE" "$NEW_FILE"
# Append our configuration
echo "include = /etc/samba/smb-ogclient.conf" >> "$NEW_FILE"
# Use ucf to handle the file update
ucf --debconf-ok "$NEW_FILE" "$OLD_FILE"
# Clean up
rm -f "$NEW_FILE"
echo "include = /etc/samba/smb-ogclient.conf" >> "$OLD_FILE"
# Reload Samba
if command -v systemctl >/dev/null 2>&1; then
@ -48,6 +42,8 @@ case "$1" in
;;
esac
chown -R opengnsys:opengnsys /opt/opengnsys/ogclient
chown -R opengnsys:opengnsys /opt/opengnsys/ogclient_log
#DEBHELPER#
exit 0

15
debian/ogclient.preinst vendored 100644
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -e
# Asegurarse de que el usuario exista
USER="opengnsys"
HOME_DIR="/opt/opengnsys"
if id "$USER" &>/dev/null; then
echo "El usuario $USER ya existe."
else
echo "Creando el usuario $USER con home en $HOME_DIR."
useradd -m -d "$HOME_DIR" -s /bin/bash "$USER"
fi
exit 0