Fixed adlists jail´s route. Added autostart of dnsmasq at jail boot

This commit is contained in:
Victor G.Enguita
2022-01-07 00:57:25 +01:00
parent f10efffef9
commit 643fe687a8
2 changed files with 14 additions and 6 deletions

View File

@ -21,8 +21,14 @@ A simple adblock dns server. Simplified version of [https://vlads.me/post/settin
```Shell ```Shell
set JAILMOUNTPOINT = "/mnt/jails" set JAILMOUNTPOINT = "/mnt/jails"
``` ```
* Uncoment this lines if you want to check config files difference before to copy them
```Shell
##diff $CONFIGS/dnsmasq_rcd $JAILMOUNTPOINT/$JAIL/usr/local/etc/rc.d/dnsmasq
##diff $CONFIGS/dnsmasq_conf $JAILMOUNTPOINT/$JAIL/usr/local/etc/dnsmasq.conf
```
### **INSTALL** ### **INSTALL**
Just launch .sh script passing an existing jail name as argument Just launch .sh script passing an existing jail name as argument

View File

@ -21,12 +21,12 @@ else
cp $CONFIGS/dnsmasq_rcd $JAILMOUNTPOINT/$JAIL/usr/local/etc/rc.d/dnsmasq cp $CONFIGS/dnsmasq_rcd $JAILMOUNTPOINT/$JAIL/usr/local/etc/rc.d/dnsmasq
cp $CONFIGS/dnsmasq_conf $JAILMOUNTPOINT/$JAIL/usr/local/etc/dnsmasq.conf cp $CONFIGS/dnsmasq_conf $JAILMOUNTPOINT/$JAIL/usr/local/etc/dnsmasq.conf
# grab some configs # grab some configs
wget --no-check-certificate https://raw.githubusercontent.com/acidwars/AdBlock-Lists/master/adblock.conf -O /usr/local/etc/dnsmasq.conf.d/20-adblock.conf wget --no-check-certificate https://raw.githubusercontent.com/acidwars/AdBlock-Lists/master/adblock.conf -O $JAILMOUNTPOINT/$JAIL//usr/local/etc/dnsmasq.conf.d/20-adblock.conf
wget --no-check-certificate https://raw.githubusercontent.com/acidwars/AdBlock-Lists/master/ads01.conf -O /usr/local/etc/dnsmasq.conf.d/21-ads01.conf wget --no-check-certificate https://raw.githubusercontent.com/acidwars/AdBlock-Lists/master/ads01.conf -O $JAILMOUNTPOINT/$JAIL//usr/local/etc/dnsmasq.conf.d/21-ads01.conf
wget --no-check-certificate https://raw.githubusercontent.com/notracking/hosts-blocklists/master/domains.txt -O /usr/local/etc/dnsmasq.conf.d/22-blocklists.conf wget --no-check-certificate https://raw.githubusercontent.com/notracking/hosts-blocklists/master/domains.txt -O $JAILMOUNTPOINT/$JAIL//usr/local/etc/dnsmasq.conf.d/22-blocklists.conf
# grab some hosts # grab some hosts
wget --no-check-certificate https://raw.githubusercontent.com/r-a-y/mobile-hosts/master/AdguardDNS.txt -O /usr/local/etc/hosts.d/adguard wget --no-check-certificate https://raw.githubusercontent.com/r-a-y/mobile-hosts/master/AdguardDNS.txt -O $JAILMOUNTPOINT/$JAIL//usr/local/etc/hosts.d/adguard
wget --no-check-certificate https://raw.githubusercontent.com/r-a-y/mobile-hosts/master/AdguardMobileAds.txt -O /usr/local/etc/hosts.d/adguard-mobile wget --no-check-certificate https://raw.githubusercontent.com/r-a-y/mobile-hosts/master/AdguardMobileAds.txt -O $JAILMOUNTPOINT/$JAIL//usr/local/etc/hosts.d/adguard-mobile
##POST ##POST
##Pass port from jail to host with pf or prefered firewall ##Pass port from jail to host with pf or prefered firewall
##Test config ##Test config
@ -36,4 +36,6 @@ else
## drill freebsd.org @ipjail #ON HOST ## drill freebsd.org @ipjail #ON HOST
##Start service ##Start service
## service dnsmasq start ## service dnsmasq start
echo "dnsmasq_enable=\"YES\"" >> $JAILMOUNTPOINT/$JAIL/etc/rc.conf
echo "dnsmasq_conf=\"/usr/local/etc/dnsmasq.conf\"">> $JAILMOUNTPOINT/$JAIL/etc/rc.conf
endif endif