Well, I realized that the script is not executed, neither the printer
created... I am stuck. This is the complete configuration:
[global]
unix charset = LOCALE
workgroup = XXXXXXXXXXXX
netbios name = XXXXXXXXXXXXXXXX
server string = Controlador de dominio %h de %D
passdb backend = ldapsam:ldaps://XXXXXXXXXXX
log level = 2
syslog = 0
log file = /var/log/samba/%m.trace
max log size = 1000
time server = Yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
# Opciones de gesti?n de recursos compartidos
add share command = /bin/bash /opt/ldap/samba/smb_share_add.sh
change share command = /bin/bash /opt/ldap/samba/smb_share_add.sh
delete share command = /bin/bash /opt/ldap/samba/smb_share_del.sh
# Opciones de gesti?n de impresi?n
add printer command = /bin/bash /opt/ldap/samba/smb_printer_add.sh
delete printer command = /bin/bash /opt/ldap/samba/smb_printer_del.sh
printcap cache time = 60
logon script = logon.cmd
logon path logon home domain logons = Yes
os level = 65
preferred master = Yes
domain master = Yes
wins support = Yes
name resolve order = wins lmhosts hosts bcast
ldap admin dn = XXXXXXXXXXXXXXX
ldap group suffix = XXXXXXXXXXXXXXXX
ldap machine suffix = XXXXXXXXXXXXXXX
ldap passwd sync = Yes
ldap suffix = XXXXXXXXXXXXX
ldap ssl = Off
template shell = /bin/bash
invalid users = root
map acl inherit = yes
ntlm auth = yes
enable privileges = yes
[homes]
comment = Directorio personal del usuario %u
root preexec = /bin/bash /opt/ldap/samba/mkhomedir.sh %u
read only = no
[printers]
comment = Impresoras
path = /var/spool/samba
printing = cups
printable = yes
[print$]
comment = Controladores de impresi?n
path = /var/lib/samba/printing
read only = no
Regards and thanks in advance.
El d?a 16 de diciembre de 2010 10:15, Juan Asensio S?nchez
<okelet at gmail.com> escribi?:> Hi
>
> I am trying to setup remote printer management commands, so the users
> could add and delete printers from "Printers" share of Samba in
> Windows. I have this script, that is launched using an administrator
> account, when I add a printer from there, using a new TCP/IP port:
>
> ===============================================================>
> #!/bin/bash
>
> {
>
> ? ? ?
?##########################################################################
> ? ? ? ?# Par?metros
> ? ? ?
?##########################################################################
>
> ? ? ? ?# Nombre de la impresora
> ? ? ? ?LPNAME=$(echo "$1" | iconv -t ascii//translit | sed
--regexp-extended
> 's/\s+/_/g')
>
> ? ? ? ?# Nombre del recurso compartido
> ? ? ? ?SHARENAME=$2
>
> ? ? ? ?# Nombre del puerto
> ? ? ? ?PORTNAME=$3
>
> ? ? ? ?# Nombre del controlador
> ? ? ? ?DRIVERNAME=$4
>
> ? ? ? ?# Localizaci?n
> ? ? ? ?LOCATION_OLD=$5
>
> ? ? ? ?# Localizaci?n en Windows 95
> ? ? ? ?LOCATIONWIN9X=$6
>
> ? ? ? ?# Comprobar la sintaxis de la localizaci?n, y a?adir el protocolo
por
> defecto si no lo tiene
> ? ? ? ?if [[ ! ${LOCATION_OLD} =~ ":/" ]]
> ? ? ? ?then
> ? ? ? ? ? ? ? ?LOCATION_NEW="lpd://${LOCATION_OLD}"
> ? ? ? ?else
> ? ? ? ? ? ? ? ?LOCATION_NEW="${LOCATION_OLD}"
> ? ? ? ?fi
>
> ? ? ? ?# Mostrar mensaje
> ? ? ? ?echo "A?adiendo impresora. Nombre: $1 (${LPNAME}); recurso:
> ${SHARENAME}; puerto: ${PORTNAME}; driver: ${DRIVERNAME};
> localizaci?n: ${LOCATION_OLD} (${LOCATION_NEW}); localizaci?n Win9X:
> ${LOCATIONWIN9X}..."
>
> ? ? ? ?# A?adir la impresora
> ? ? ? ?/usr/sbin/lpadmin -p "${SHARENAME}" -D
"${DRIVERNAME}" -E -v "${LOCATION_NEW}"
>
>
> ? ? ? ?# Recargar la configuraci?n de Samba
> ? ? ? ?/etc/init.d/smb reload
>
> } 2>&1 | logger -t SMB_PRINTER_ADD
>
> ===============================================================>
> The printer is recognized correctly in the wizard, but when I press
> the Finish button, i get ever "Access denied", although the
printer
> has been created correctly in /etc/printcap. What am I doing wrong?
>
> Regards.
>