Skip to content

Commit

Permalink
tweaked run.sh
Browse files Browse the repository at this point in the history
* added exit to docker-compose command
* fixed missed HOST_IP declaration
* added 'change pw' reminder when random pw
  • Loading branch information
Cielquan committed Aug 6, 2019
1 parent c603ec9 commit e6452ef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Start docker container
echo ""
docker-compose up -d
docker-compose up -d || exit 1


echo -e "\n####################\n"
Expand Down Expand Up @@ -53,10 +53,13 @@ printf '\nINFO! Starting up pihole container '
for i in $(seq 1 20); do
if [ "$(docker inspect -f "{{.State.Health.Status}}" pihole)" == "healthy" ]; then
printf ' OK'
HOST_IP=$(grep 'ServerIP' pihole-docker/configs/server.conf | sed 's/ServerIP=//')
if [ "$(docker logs pihole 2> /dev/null | grep -c 'password:')" -gt 0 ]; then
echo -e "\nINFO! $(docker logs pihole 2> /dev/null | grep 'password:') for your pi-hole: https://${HOST_IP}/admin/"
RAN_PW='y'
else
echo -e "\nINFO! Set given WEBPASSWORD for your pi-hole: https://${HOST_IP}/admin/"
RAN_PW='n'
fi
break
else
Expand Down Expand Up @@ -145,3 +148,7 @@ printf "\nINFO! Container health status of 'nginx': " && docker inspect -f {{.St

echo -e "\nSUCCESS! docker-pihole-unbound-encrypted is up and running."
echo -e "\n####################"

if echo ${RAN_PW} | grep -q 'y'; then
echo -e "\nPlease don't forget to set a secure password for your pihole dashboard.\nRun 'sudo docker exec pihole pihole -a -p' to change it."
fi

0 comments on commit e6452ef

Please sign in to comment.