mirror of
https://gitlab.com/Snogard/kaido.git
synced 2025-08-20 10:50:06 +02:00
added pihole
This commit is contained in:
parent
93a80f0035
commit
0a00c2961d
56
src/commands/install/install-pihole.sh
Executable file
56
src/commands/install/install-pihole.sh
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
source /opt/kaido/src/libs/bash/lib.sh
|
||||
# docs https://hub.docker.com/r/pihole/pihole
|
||||
|
||||
# setup
|
||||
imageName=docker.io/pihole/pihole:2023.03.1
|
||||
containerName=pihole
|
||||
|
||||
srcConfigPath=/home-server/configuration/$containerName
|
||||
baseConfigPath=/mnt/storage/containers/$containerName/config
|
||||
|
||||
dstPiholeConfigPath=$baseConfigPath/pihole
|
||||
dstDnsmasqConfigPath=$baseConfigPath/dnsmasq
|
||||
|
||||
|
||||
# envs
|
||||
webport=10105
|
||||
virtual_host=pihole_host
|
||||
timezone=Europe/Rome
|
||||
|
||||
if [ -f "/etc/kaido/containers/$containerName/envs.sh" ]; then
|
||||
source /etc/kaido/containers/$containerName/envs.sh
|
||||
fi
|
||||
|
||||
# pre install
|
||||
create_folder "$dstPiholeConfigPath"
|
||||
create_folder "$dstDnsmasqConfigPath"
|
||||
stop_and_remove_container $containerName
|
||||
|
||||
# firewall
|
||||
echo "Checking firewall rules"
|
||||
|
||||
echo "Allowing dns"
|
||||
sudo ufw allow 53/tcp
|
||||
sudo ufw allow 53/udp
|
||||
|
||||
echo "Allowing dhcp"
|
||||
sudo ufw allow 67/udp
|
||||
|
||||
|
||||
# install
|
||||
echo "Creating new container"
|
||||
podman create \
|
||||
--name $containerName \
|
||||
--net=host \
|
||||
-e WEB_PORT=$webport \
|
||||
-e TZ="$timezone" \
|
||||
-e VIRTUAL_HOST="$virtual_host" \
|
||||
-v $dstPiholeConfigPath:/etc/pihole \
|
||||
-v $dstDnsmasqConfigPath:/etc/dnsmasq \
|
||||
$imageName
|
||||
|
||||
|
||||
#systemd
|
||||
create_systemd_services $podName
|
||||
systemctl --user enable --now $containerName
|
@ -64,5 +64,4 @@ podman create \
|
||||
# systemd
|
||||
|
||||
create_systemd_services $podName
|
||||
|
||||
systemctl --user enable --now $podName
|
Loading…
x
Reference in New Issue
Block a user