ipfire 2 dnsmasq script to generate wildcard subdomains for dhcp-leases

revision 7557ded6c3a2107b2de899a1613d5c493017e935

raw

error.log

1
2
3
4
5
6
[root@ipfire cgi-bin]# /etc/init.d/dnsmasq restart
Stopping Domain Name Service Proxy... [  OK  ]
Starting Domain Name Service Proxy...
dnsmasq: recompile with HAVE_SCRIPT defined to enable lease-change scripts at line 4 of /etc/dnsmasq.conf
                                      [ FAIL ]
 
raw

usr-local-bin-dnsmasq-dhcp-wildcards.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
tld=.example
 
mode=$1
ip=$2
name=$3$tld
 
filename="/etc/dnsmasq.d/wildcard-dhcp-$name.conf"
echo $@ >> /tmp/log
if [ "$mode" == add ]; then
    echo "address=/.$name/$ip/" > "$filename"
elif [ "$mode" == del ]; then
    rm "$filename"
fi
 

History