Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # https://github.com/pi-hole/docker-pi-hole/blob/master/README.md
  4.  
  5. docker run -d \
  6. --name pihole \
  7. -p 53:53/tcp -p 53:53/udp \
  8. -p 80:80 \
  9. -p 443:443 \
  10. -e TZ="America/Chicago" \
  11. -v "/volume1/docker/pihole/etc/:/etc/pihole/" \
  12. -v "/volume1/docker/pihole/dnsmasq.d/:/etc/dnsmasq.d/" \
  13. --dns=1.1.1.1 \
  14. --restart=unless-stopped \
  15. pihole/pihole:latest
  16.  
  17. printf 'Starting up pihole container '
  18. for i in $(seq 1 20); do
  19. if [ "$(docker inspect -f "{{.State.Health.Status}}" pihole)" == "healthy" ] ; then
  20. printf ' OK'
  21. echo -e "\n$(docker logs pihole 2> /dev/null | grep 'password:') for your pi-hole: https://${IP}/admin/"
  22. exit 0
  23. else
  24. sleep 3
  25. printf '.'
  26. fi
  27.  
  28. if [ $i -eq 20 ] ; then
  29. echo -e "\nTimed out waiting for Pi-hole start, consult check your container logs for more info (\`docker logs pihole\`)"
  30. exit 1
  31. fi
  32. done;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement