diff --git a/services/pihole/build.sh b/services/pihole/build.sh new file mode 100644 index 0000000..76a28e6 --- /dev/null +++ b/services/pihole/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Nothing to build!" diff --git a/services/pihole/start.sh b/services/pihole/start.sh new file mode 100755 index 0000000..c0997a5 --- /dev/null +++ b/services/pihole/start.sh @@ -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 diff --git a/services/pihole/stop.sh b/services/pihole/stop.sh new file mode 100644 index 0000000..77cdecb --- /dev/null +++ b/services/pihole/stop.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +podman rm -f pihole