mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-02-12 19:31:54 +00:00
Fix pi hole interface listen on all network
This commit is contained in:
parent
5cd78a9401
commit
3280bd3062
1 changed files with 42 additions and 0 deletions
42
omr-pihole.sh
Normal file
42
omr-pihole.sh
Normal file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
echo "You can select any interface and set any IPs during Pi-hole configuration, this will be modified for OpenMPTCProuter at the end."
|
||||
echo "Don't apply Pi-hole firewall rules."
|
||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
[ "`tty`" != "not a tty" ] && read -n 1 -s -r -p "Press any key to continue" || sleep 5
|
||||
|
||||
echo "Run Pi-hole install script..."
|
||||
curl -sSL https://install.pi-hole.net | bash
|
||||
echo "Done"
|
||||
echo "-------------------------------------------------------------------------------------------------------------------------------"
|
||||
echo "OMR Pi-hole configuration..."
|
||||
cat > /etc/lighttpd/external.conf << 'EOF'
|
||||
server.bind="10.255.255.1"
|
||||
$SERVER["socket"] == "10.255.254.1:80" { }
|
||||
$SERVER["socket"] == "10.255.252.1:80" { }
|
||||
$SERVER["socket"] == "10.255.253.1:80" { }
|
||||
EOF
|
||||
systemctl -q restart lighttpd
|
||||
grep -v -e PIHOLE_INTERFACE -e IPV4_ADDRESS -e IPV6_ADDRESS /etc/pihole/setupVars.conf > /etc/pihole/setupVars.new.conf
|
||||
mv /etc/pihole/setupVars.new.conf /etc/pihole/setupVars.conf
|
||||
cat >> /etc/pihole/setupVars.conf <<-EOF
|
||||
PIHOLE_INTERFACE=gt-tun0
|
||||
IPV4_ADDRESS=10.255.0.0/16
|
||||
IPV6_ADDRESS=fe80::aff:ff01/64
|
||||
EOF
|
||||
|
||||
grep -v interface /etc/dnsmasq.d/01-pihole.conf > /etc/dnsmasq.d/01-pihole.new.conf
|
||||
mv /etc/dnsmasq.d/01-pihole.new.conf /etc/dnsmasq.d/01-pihole.conf
|
||||
cat > /etc/dnsmasq.d/99-omr.conf <<-EOF
|
||||
interface=gt-tun0
|
||||
interface=gt-udp-tun0
|
||||
interface=tun0
|
||||
interface=mlvpn0
|
||||
EOF
|
||||
systemctl -q restart pihole-FTL
|
||||
echo "Done"
|
||||
echo "======================================================================================================================================"
|
||||
echo "To use Pi-hole in OpenMPTCProuter, you need to 'Save & Apply' the wizard again in System->OpenMPTCProuter then reboot OpenMPTCProuter."
|
||||
echo "Web interface will be available on 10.255.255.1 if you use Glorytun TCP, 10.255.254.1 if you use Glorytun UDP."
|
||||
echo "======================================================================================================================================"
|
||||
exit 0
|
Loading…
Reference in a new issue