docker-pi-hole/start.sh

46 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash -e
# Dockerfile variables
export TAG
export ServerIP
export ServerIPv6
export PYTEST
export PHP_ENV_CONFIG
export PHP_ERROR_LOG
export HOSTNAME
2016-11-06 20:41:14 +01:00
export WEBLOGDIR
export DNS1
export DNS2
2017-03-05 00:31:09 +01:00
export INTERFACE
2016-11-06 20:41:14 +01:00
export IPv6
2017-11-15 05:33:05 +01:00
export WEBPASSWORD
export WEB_PORT
2016-11-06 20:41:14 +01:00
export adlistFile='/etc/pihole/adlists.list'
# The below functions are all contained in bash_functions.sh
. /bash_functions.sh
# Some of the bash_functions use variables these core pi-hole/web scripts
. /opt/pihole/webpage.sh
# PH_TEST prevents the install from actually running (someone should rename that)
PH_TEST=true . $PIHOLE_INSTALL
echo " ::: Starting docker specific setup for docker diginc/pi-hole"
validate_env || exit 1
prepare_setup_vars
change_setting "IPV4_ADDRESS" "$ServerIP"
change_setting "IPV6_ADDRESS" "$ServerIPv6"
2017-11-15 05:33:05 +01:00
setup_web_port "$WEB_PORT"
2017-02-09 05:46:46 +01:00
setup_web_password "$WEBPASSWORD"
setup_dnsmasq "$DNS1" "$DNS2" "$INTERFACE"
setup_php_env
setup_dnsmasq_hostnames "$ServerIP" "$ServerIPv6" "$HOSTNAME"
setup_ipv4_ipv6
setup_lighttpd_bind "$ServerIP"
setup_blocklists
test_configs
[ -f /.piholeFirstBoot ] && rm /.piholeFirstBoot
2018-01-05 05:30:40 +01:00
echo "::: Docker start setup complete"