qusal/salt/sys-pihole/files/server/network-hooks.d/50-sys-pihole.sh
2024-01-29 16:49:54 +01:00

20 lines
531 B
Bash

#!/bin/sh
# SPDX-FileCopyrightText: 2022 - 2023 unman <unman@thirdeyesecurity.org>
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
set -eu
nft -f /rw/config/qubes-firewall.d/50-sys-pihole
for vif in /proc/sys/net/ipv4/conf/vif*/route_localnet; do
test -w "${vif}" || continue
echo 1 | tee "${vif}" >/dev/null
done
if test -f /var/run/qubes-service/local-dns-server; then
echo "nameserver 127.0.0.1" | tee /etc/resolv.conf >/dev/null
fi