[Dnsmasq-discuss] Lease Time Detail

Helmut Hullen Hullen at t-online.de
Thu Sep 22 14:08:00 BST 2011


Hallo, Pratik,

Du meintest am 22.09.11:

> And can I pls ask u to show me a simple script to do so??? I m
> totally naive for scripting so.. Thanks in advance.. :)

Just an example:

Part of "/etc/dnsmasq.conf":

        dhcp-script=/root/bin/clientname

Script "/root/bin/clientname":

#! /bin/bash
# meldet den Client-Name fuer dnsmasq
# wird in der "dnsmasq"-Konfiguration von "dhcp-script" aufgerufen

test "$DNSMASQ_SUPPLIED_HOSTNAME" || exit

export LC_ALL=C
Log=/var/log/clients.log

echo -e "${2}\t${3}\t${DNSMASQ_SUPPLIED_HOSTNAME}\t"$(date +%F\ %X) >> $Log
#

# -------------------------------------------------------------

That script has another purpose than you want, but you may see how to  
use the dnsmasq variables.

You can see more details via

        man dnsmasq

under "-6 --dhcp-script"

The meaning of "${1}" to "${4}" is explained under "arguments" in this  
paragraph.
p.e.: "${2}" contains the MAC address.

Viele Gruesse!
Helmut



More information about the Dnsmasq-discuss mailing list