feat(pihole): add pihole service

This commit is contained in:
Marc 2024-04-04 13:36:03 -04:00
parent 03f66f7dd3
commit 65c762cf76
Signed by: marc
GPG key ID: 048E042F22B5DC79
3 changed files with 43 additions and 0 deletions

3
services/pihole/build.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
echo "Nothing to build!"

37
services/pihole/start.sh Executable file
View file

@ -0,0 +1,37 @@
#!/usr/bin/bash
podman volume exists pihole-etc
if [[ "$?" == "1" ]]; then
podman volume create \
--label type=service \
"pihole-etc"
echo "Created volume pihole-etc."
else
echo "Volume pihole-etc already exists."
fi
podman volume exists pihole-dnsmasq
if [[ "$?" == "1" ]]; then
podman volume create \
--label type=service \
"pihole-dnsmasq"
echo "Created volume pihole-dnsmasq."
else
echo "Volume pihole-dnsmasq already exists."
fi
podman run \
-td \
--replace \
--name "pihole" \
-e WEBPASSWORD="$PIHOLE_INITIAL_PASSWORD" \
-e SERVERIP="${PIHOLE_SERVER_IP:-"127.0.0.1"}" \
-p 53:53/tcp \
-p 53:53/udp \
-p 67:67/udp \
-p 80:80 \
-p 443:443 \
-v pihole-etc:/etc/pihole \
-v pihole-dnsmasq:/etc/dnsqmasq.d \
--cap-add=NET_ADMIN \
pihole/pihole:2024.03.2

3
services/pihole/stop.sh Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/bash
podman rm -f pihole