Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
|
- #!/bin/bash
-
- echo ""
- echo "Adding DNS entries to PI-HOLE"
-
- CONF_FILE=custom_dnsmasq.conf
-
- IP_LOOKUP="$(ip route get 8.8.8.8 | awk '{ print $NF; exit }')" # May not work for VPN / tun0
-
- # read variables, for domain and host names
- source .env
-
- # global domain with all subdomains
- echo address=/.${DOMAIN}/${IP_LOOKUP} > /tmp/${CONF_FILE}
- # virtual domains
- for domain in ${VIRTUAL_DOMAINS[@]}; do
- echo address=/.${domain}/${IP_LOOKUP} >> /tmp/${CONF_FILE}
- done;
-
- # ##### Add entries to PiHole ###### #
-
- container=$(docker ps | grep pihole | cut -f1 -d" ")
- #echo Container=$container
- if [ -z $container ]; then
- echo "Qué me estás container?!";
- exit 1;
- fi
-
- echo Copying user files to Container $container
- docker cp /tmp/${CONF_FILE} $container:/etc/dnsmasq.d/99-local-addresses.conf
- # restart dns
- docker exec ${container} pihole reloaddns
-
- echo Removing copied user files
- docker exec ${container} sh -c 'rm -Rf /tmp/${CONF_FILE}'
- rm -Rf /tmp/${CONF_FILE}
|