Changeset 1697 for pykota/trunk/bin

Show
Ignore:
Timestamp:
09/02/04 18:01:01 (20 years ago)
Author:
jalet
Message:

Improved messaging system when IP address is needed for smbclient -M

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/mailandpopup.sh

    r1527 r1697  
    3939# 
    4040# Launch WinPopup on user's host (may need a real Samba or NT domain)  
    41 echo "$UTF8MESSAGE" | smbclient -M "$UNAME" 2>&1 >/dev/null 
     41# In some cases the username does not suffice for smbclient to send a message; 
     42# we must also supply the IP address. This will use smbstatus to get all IPs 
     43# where the user is logged in and send the message there: 
     44IPS=`smbstatus -b -u $UNAME | grep '(' | cut -d'(' -f 2 | cut -d')' -f 1` 
     45for i in $IPS; do 
     46    echo $UTF8MESSAGE | smbclient -M "$UNAME" -I $i 2>&1 >/dev/null; 
     47done