Пытаюсь создать скрипт, чтобы выдавал сообщение юзерям, которые заходят через Samba.
MESSAGE="test"
for i in `smbstatus | grep '(\w\+\.\w\+\.\w\+\.\w\+)' `; do
echo $i | read SHARE USER GROUP MACHINE IP JUNK
echo $MESSAGE | smbclient -M $MACHINE -I $IP
done
выдаёт ошибку
Connection to -I failed. Error NT_STATUS_BAD_NETWORK_NAME
конфиг, как в мануалах
# Samba config file created using SWAT
# from 192.168.23.6 (192.168.23.6)
# Date: 2008/01/18 10:36:22
[global]
dos charset = 866
unix charset = koi8-r
display charset = 866
workgroup = ZHILSERVICE
realm = ZHIL
netbios name = FILESERV
netbios aliases = ZHIL0
server string = FILESERV
interfaces = em0
log file = /var/log/samba/log.%m
max log size = 1024
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = yes
domain master = yes
preferred master = yes
os level = 128
dns proxy = No
wins support = yes
hosts allow = 192.168.23.0/255.255.255.0, 192.168.26.0/255.255.255.0, 192.168.27.0/255.255.255.248
message command = sh -c 'echo %f%m%t%s > /storage/MESSAGE.txt' &
[homes]
comment = Home Directories
read only = No
create mask = 0700
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No