2017-02-09 20:01:34 +01:00
|
|
|
#!/bin/bash -e
|
2016-10-07 02:46:20 +02:00
|
|
|
# Dockerfile variables
|
2017-10-04 18:05:27 +02:00
|
|
|
export TAG
|
2016-10-07 02:46:20 +02:00
|
|
|
export ServerIP
|
|
|
|
export ServerIPv6
|
|
|
|
export PYTEST
|
|
|
|
export PHP_ENV_CONFIG
|
|
|
|
export PHP_ERROR_LOG
|
2016-10-30 18:13:52 +01:00
|
|
|
export HOSTNAME
|
2016-11-06 20:41:14 +01:00
|
|
|
export WEBLOGDIR
|
2017-01-18 05:49:42 +01:00
|
|
|
export DNS1
|
|
|
|
export DNS2
|
2017-03-05 00:31:09 +01:00
|
|
|
export INTERFACE
|
2018-09-29 22:17:21 +02:00
|
|
|
export DNSMASQ_LISTENING_BEHAVIOUR="$DNSMASQ_LISTENING"
|
2016-11-06 20:41:14 +01:00
|
|
|
export IPv6
|
2017-11-15 05:33:05 +01:00
|
|
|
export WEB_PORT
|
2016-11-06 20:41:14 +01:00
|
|
|
|
2018-07-30 01:14:24 +02:00
|
|
|
export adlistFile='/etc/pihole/adlists.list'
|
|
|
|
|
|
|
|
# The below functions are all contained in bash_functions.sh
|
2017-01-18 05:49:42 +01:00
|
|
|
. /bash_functions.sh
|
2016-10-07 02:46:20 +02:00
|
|
|
|
2018-07-30 01:14:24 +02:00
|
|
|
# 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
|
|
|
|
|
2018-08-04 18:40:31 +02:00
|
|
|
echo " ::: Starting docker specific setup for docker pihole/pihole"
|
2019-01-09 04:01:19 +01:00
|
|
|
docker_checks
|
2019-02-06 11:02:30 +01:00
|
|
|
fix_capabilities
|
2018-09-18 07:11:26 +02:00
|
|
|
generate_password
|
2017-05-19 07:36:53 +02:00
|
|
|
validate_env || exit 1
|
2018-08-03 05:49:55 +02:00
|
|
|
prepare_configs
|
2017-01-18 05:49:42 +01:00
|
|
|
change_setting "IPV4_ADDRESS" "$ServerIP"
|
|
|
|
change_setting "IPV6_ADDRESS" "$ServerIPv6"
|
2017-11-15 05:33:05 +01:00
|
|
|
setup_web_port "$WEB_PORT"
|
2018-09-18 07:11:26 +02:00
|
|
|
setup_web_password "$WEBPASSWORD"
|
2018-09-29 22:17:21 +02:00
|
|
|
setup_dnsmasq "$DNS1" "$DNS2" "$INTERFACE" "$DNSMASQ_LISTENING_BEHAVIOUR"
|
2017-01-18 05:49:42 +01:00
|
|
|
setup_php_env
|
2016-10-30 18:13:52 +01:00
|
|
|
setup_dnsmasq_hostnames "$ServerIP" "$ServerIPv6" "$HOSTNAME"
|
2016-10-21 05:36:55 +02:00
|
|
|
setup_ipv4_ipv6
|
2018-07-30 01:14:24 +02:00
|
|
|
setup_lighttpd_bind "$ServerIP"
|
|
|
|
setup_blocklists
|
2016-10-07 02:46:20 +02:00
|
|
|
test_configs
|
2016-03-28 16:23:37 +02:00
|
|
|
|
2017-11-20 06:15:44 +01:00
|
|
|
[ -f /.piholeFirstBoot ] && rm /.piholeFirstBoot
|
|
|
|
|
2018-08-03 05:49:55 +02:00
|
|
|
echo " ::: Docker start setup complete"
|