From 494a89f1813f67b2597cb29e22ee047815d6e35d Mon Sep 17 00:00:00 2001
From: Amir Zarrinkafsh <nightah@me.com>
Date: Thu, 25 Jun 2020 09:15:42 +1000
Subject: [PATCH] Generate lancache.conf based on specified cache entries

---
 scripts/create-dnsmasq.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/create-dnsmasq.sh b/scripts/create-dnsmasq.sh
index da12c87..ab32a80 100755
--- a/scripts/create-dnsmasq.sh
+++ b/scripts/create-dnsmasq.sh
@@ -27,6 +27,7 @@ done <<< $(jq -r '.cache_domains | to_entries[] | .key' config.json)
 
 rm -rf ${outputdir}
 mkdir -p ${outputdir}
+touch ${outputdir}/lancache.conf
 while read -r entry; do
         unset cacheip
         unset cachename
@@ -44,6 +45,7 @@ while read -r entry; do
                 while read -r filename; do
                         destfilename=$(echo $filename | sed -e 's/txt/hosts/')
                         outputfile=${outputdir}/${destfilename}
+                        echo "addn-hosts=/etc/dnsmasq.d/${destfilename}" >> ${outputdir}/lancache.conf
                         touch "$outputfile"
                         while read -r fileentry; do
                                 # Ignore comments