#!/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
