1
0
mirror of https://github.com/pi-hole/docker-pi-hole.git synced 2024-06-20 06:26:38 +02:00

entrypoint start script modifications for issues

- piholeIPv6 in setupVars.txt fixes #50
- firstboot multipel runs fixes #51
 - really only necessary for debian, but I like symmetry in the start files
This commit is contained in:
diginc 2016-10-05 21:55:08 -05:00
parent 5f6c599302
commit ee2949aba8
3 changed files with 42 additions and 18 deletions

View File

@ -6,15 +6,23 @@ fi;
# /tmp/piholeIP is the current override of auto-lookup in gravity.sh
echo "$ServerIP" > /etc/pihole/piholeIP;
echo "[www]" > $PHP_ENV_CONFIG;
echo "env[PATH] = ${PATH}" >> $PHP_ENV_CONFIG;
echo "env[PHP_ERROR_LOG] = ${PHP_ERROR_LOG}" >> $PHP_ENV_CONFIG;
echo "env[ServerIP] = ${ServerIP}" >> $PHP_ENV_CONFIG;
echo "ipv4addr=$ServerIP" > /etc/pihole/setupVars.conf;
echo "piholeIPv6=$ServerIPv6" >> /etc/pihole/setupVars.conf;
if [ -n "$VIRTUAL_HOST" ] ; then
echo "env[VIRTUAL_HOST] = ${VIRTUAL_HOST}" >> $PHP_ENV_CONFIG;
if [ ! -f /var/run/dockerpihole-firstboot ] ; then
echo "[www]" > $PHP_ENV_CONFIG;
echo "env[PATH] = ${PATH}" >> $PHP_ENV_CONFIG;
echo "env[PHP_ERROR_LOG] = ${PHP_ERROR_LOG}" >> $PHP_ENV_CONFIG;
echo "env[ServerIP] = ${ServerIP}" >> $PHP_ENV_CONFIG;
if [ -z "$VIRTUAL_HOST" ] ; then
VIRTUAL_HOST="$ServerIP"
fi;
echo "env[VIRTUAL_HOST] = ${VIRTUAL_HOST}" >> $PHP_ENV_CONFIG;
touch /var/run/dockerpihole-firstboot
else
echo "env[VIRTUAL_HOST] = ${ServerIP}" >> $PHP_ENV_CONFIG;
echo "Skipped first boot configuration, looks like you're restarting this container"
fi;
echo "Added ENV to php:"

View File

@ -6,13 +6,21 @@ fi;
# /tmp/piholeIP is the current override of auto-lookup in gravity.sh
echo "$ServerIP" > /etc/pihole/piholeIP;
sed -i "/bin-environment/ a\\\t\t\t\"ServerIP\" => \"${ServerIP}\"," $PHP_ENV_CONFIG
sed -i "/bin-environment/ a\\\t\t\t\"PHP_ERROR_LOG\" => \"${PHP_ERROR_LOG}\"," $PHP_ENV_CONFIG
echo "ipv4addr=$ServerIP" > /etc/pihole/setupVars.conf;
echo "piholeIPv6=$ServerIPv6" >> /etc/pihole/setupVars.conf;
if [ -n "$VIRTUAL_HOST" ] ; then
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${VIRTUAL_HOST}\"," $PHP_ENV_CONFIG
else
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${ServerIP}\"," $PHP_ENV_CONFIG
if [ ! -f /var/run/dockerpihole-firstboot ] ; then
sed -i "/bin-environment/ a\\\t\t\t\"ServerIP\" => \"${ServerIP}\"," $PHP_ENV_CONFIG
sed -i "/bin-environment/ a\\\t\t\t\"PHP_ERROR_LOG\" => \"${PHP_ERROR_LOG}\"," $PHP_ENV_CONFIG
if [ -z "$VIRTUAL_HOST" ] ; then
VIRTUAL_HOST="$ServerIP"
fi;
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${VIRTUAL_HOST}\"," $PHP_ENV_CONFIG
touch /var/run/dockerpihole-firstboot
else
echo "Skipped first boot configuration, looks like you're restarting this container"
fi;
echo "Added ENV to php:"

18
debian/start.sh vendored
View File

@ -6,13 +6,21 @@ fi;
# /tmp/piholeIP is the current override of auto-lookup in gravity.sh
echo "$ServerIP" > /etc/pihole/piholeIP;
sed -i "/bin-environment/ a\\\t\t\t\"ServerIP\" => \"${ServerIP}\"," $PHP_ENV_CONFIG
sed -i "/bin-environment/ a\\\t\t\t\"PHP_ERROR_LOG\" => \"${PHP_ERROR_LOG}\"," $PHP_ENV_CONFIG
echo "ipv4addr=$ServerIP" > /etc/pihole/setupVars.conf;
echo "piholeIPv6=$ServerIPv6" >> /etc/pihole/setupVars.conf;
if [ -n "$VIRTUAL_HOST" ] ; then
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${VIRTUAL_HOST}\"," $PHP_ENV_CONFIG
if [ ! -f /var/run/dockerpihole-firstboot ] ; then
sed -i "/bin-environment/ a\\\t\t\t\"ServerIP\" => \"${ServerIP}\"," $PHP_ENV_CONFIG
sed -i "/bin-environment/ a\\\t\t\t\"PHP_ERROR_LOG\" => \"${PHP_ERROR_LOG}\"," $PHP_ENV_CONFIG
if [ -z "$VIRTUAL_HOST" ] ; then
VIRTUAL_HOST="$ServerIP"
fi;
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${VIRTUAL_HOST}\"," $PHP_ENV_CONFIG
touch /var/run/dockerpihole-firstboot
else
sed -i "/bin-environment/ a\\\t\t\t\"VIRTUAL_HOST\" => \"${ServerIP}\"," $PHP_ENV_CONFIG
echo "Skipped first boot configuration, looks like you're restarting this container"
fi;
echo "Added ENV to php:"