Fixes permissions and samba configuration
parent
d748bb18d1
commit
42b5e7a827
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue