Koozali.org: home of the SME Server

message to client when it asks for ip

Joao Bento

message to client when it asks for ip
« on: September 26, 2003, 08:33:08 PM »
Hello ppl,

how could I make an action to send a message with "smbclient -M $CLIENT" when (or after) $CLIENT connects and asks an IP to the dchpd ? I'm using SME 5.6u5

Thanks
João

Nathan Fowler

Re: message to client when it asks for ip
« Reply #1 on: September 27, 2003, 12:43:27 AM »
Could you perhaps tail the dhcp configuration/log and smbclient -M $CLIENTIPADDR everytime output is returned?

Maybe use some perl code to tail and a regexp() to filter out the IP.

Rob Wilkins

Re: message to client when it asks for ip
« Reply #2 on: December 06, 2003, 01:29:32 PM »
I am almost looking for the same solution.  I would like a winpopup notification when email arrives at the server.

This is what i got so far:
tail -f /var/log/qmail/current | grep -B 1 "to local" | smbclient -M pc > /dev/null 2>&1

It doesn't work. At least the tail and grep work, however smbclient -M stops and asks for a control-d to stop and send the message.
I saw somewhere the > /dev... stuff, and tried it, but no go.

I was sure I saw something like this posted a couple years ago, and sure it must be possible to do somwhow. A person could backgroud it with "&" and turn it into a task.

This may work for your idea for maybe watching the dhcp logs as well. We just got to find that old post, or if someone out there remembers.

Later.