[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tool for sending Windows popup messages?



On Mon, 25 Aug 2003, Joe Emenaker wrote:

> Is there some Debian tool that would let me specify an IP and a message
> and it would handle the delivery without making me bother with finding
> out the NetBIOS name, etc.?

It's not what you want, but this might work.

No comments on the legality of what you want to do.


#!/bin/sh

# grabs the pcname using nmblookup and dumps it to a file.

nmblookup -A $1 | head --lines=2 | tail --lines=1 | awk '{print $1}' > pcname

# checks if the filesize is greater than one, which indicates something
# was written to it(like the remote pcname)

if [ `ls -l pcname | awk '{print $5}'` -gt 1 ]; then

echo "your statement on fixing" | smbclient -U yourname -I $1 -M `cat name`;
else
        echo "Couldn't find servername(or Mike can't code)"
fi;


Call it with ./filename IP, of course.

It'll probably horribly break if it can't find some of this stuff, and my
redirect into a file called pcname is just ugly.  So's the head/tail
thing, actually.  You can clean it up and add your own error detection.

I'm sure I also won a useless use of cat award too.  I'll put it in my
collection.

Someone have a way to clean that up, so it can be done in one chain?

Mike



Reply to: