mirror of
https://github.com/YunoHost-Apps/pihole_ynh.git
synced 2024-09-03 20:05:58 +02:00
Redirect to localhost
This commit is contained in:
parent
93e2b5875e
commit
1616cf03ac
3 changed files with 6 additions and 7 deletions
|
@ -179,9 +179,7 @@ setupVars="$pihole_storage/setupVars.conf"
|
|||
# Trouve l'interface réseau par défaut
|
||||
main_iface=$(route | grep default | awk '{print $8;}' | head -n1)
|
||||
echo "PIHOLE_INTERFACE=$main_iface" > $setupVars
|
||||
# Trouve l'ipv4 associée à l'interface trouvée
|
||||
localipv4=$(ifconfig | grep -A 1 "$main_iface" | tail -1 | awk '{print $2;}' | cut -d: -f2)
|
||||
echo "IPV4_ADDRESS=$localipv4" >> $setupVars
|
||||
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
|
||||
echo "IPV6_ADDRESS=" >> $setupVars
|
||||
echo "PIHOLE_DNS_1=" >> $setupVars
|
||||
echo "PIHOLE_DNS_2=" >> $setupVars
|
||||
|
@ -224,6 +222,9 @@ ynh_replace_string "^cache-size=" "#pihole# cache-size=" /etc/dnsmasq.conf
|
|||
# CONFIGURE DNS FOR THE LOCAL DOMAINS
|
||||
#=================================================
|
||||
|
||||
# Trouve l'ipv4 associée à l'interface trouvée
|
||||
localipv4=$(ifconfig | grep -A 1 "$main_iface" | tail -1 | awk '{print $2;}' | cut -d: -f2)
|
||||
|
||||
# Liste les domaines de yunohost
|
||||
while read perdomain
|
||||
do
|
||||
|
|
|
@ -176,7 +176,7 @@ setupVars="/etc/pihole/setupVars.conf"
|
|||
|
||||
echo "PIHOLE_INTERFACE=$main_iface" > $setupVars
|
||||
ynh_replace_string "^PIHOLE_INTERFACE=.*" "PIHOLE_INTERFACE=$main_iface" $setupVars
|
||||
ynh_replace_string "^IPV4_ADDRESS=.*" "IPV4_ADDRESS=$localipv4" $setupVars
|
||||
ynh_replace_string "^IPV4_ADDRESS=.*" "IPV4_ADDRESS=127.0.0.1" $setupVars
|
||||
|
||||
ynh_store_file_checksum "$setupVars" # Enregistre la somme de contrôle du fichier de config
|
||||
|
||||
|
|
|
@ -133,9 +133,7 @@ ynh_backup_if_checksum_is_different "$setupVars" # Créé un backup du fichier d
|
|||
# Trouve l'interface réseau par défaut
|
||||
main_iface=$(route | grep default | awk '{print $8;}' | head -n1)
|
||||
echo "PIHOLE_INTERFACE=$main_iface" > $setupVars
|
||||
# Trouve l'ipv4 associée à l'interface trouvée
|
||||
localipv4=$(ifconfig | grep -A 1 "$main_iface" | tail -1 | awk '{print $2;}' | cut -d: -f2)
|
||||
echo "IPV4_ADDRESS=$localipv4" >> $setupVars
|
||||
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
|
||||
echo "IPV6_ADDRESS=" >> $setupVars
|
||||
echo "PIHOLE_DNS_1=" >> $setupVars
|
||||
echo "PIHOLE_DNS_2=" >> $setupVars
|
||||
|
|
Loading…
Add table
Reference in a new issue