1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pihole_ynh.git synced 2024-09-03 20:05:58 +02:00

Fix stretch internet connection issue

This commit is contained in:
Maniack Crudelis 2018-07-14 22:21:32 +02:00
parent 09329575a4
commit 2b837769ec
5 changed files with 15 additions and 8 deletions

View file

@ -1,7 +1,8 @@
#!/bin/bash
# Dependencies
app_depencencies="dhcpcd5 sqlite idn2"
app_depencencies="sqlite idn2"
# dhcpcd5 has been removed because it can cause some problems with the internet connection.
if [ "$(lsb_release --codename --short)" != "jessie" ]; then
app_depencencies="$app_depencencies php-sqlite3"
else

View file

@ -21,6 +21,12 @@ new_path=$YNH_APP_NEW_PATH
app=$YNH_APP_INSTANCE_NAME
#=================================================
# LOAD SETTINGS
#=================================================
final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# CHECK THE SYNTAX OF THE PATHS
#=================================================

View file

@ -188,7 +188,7 @@ ynh_exec_warn_less systemctl enable pihole-FTL
setupVars="$pihole_storage/setupVars.conf"
# Trouve l'interface réseau par défaut
main_iface=$(route | grep default | awk '{print $8;}' | head -n1)
main_iface=$(ip route | grep default | awk '{print $5;}')
echo "PIHOLE_INTERFACE=$main_iface" > $setupVars
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
echo "IPV6_ADDRESS=" >> $setupVars
@ -237,7 +237,7 @@ ynh_replace_string "^cache-size=" "#pihole# cache-size=" /etc/dnsmasq.conf
#=================================================
# Trouve l'ipv4 associée à l'interface trouvée
localipv4=$(ifconfig | grep -A 1 "$main_iface" | tail -1 | awk '{print $2;}' | cut -d: -f2)
localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1)
# Liste les domaines de yunohost
while read perdomain
@ -268,9 +268,9 @@ then
a_range=$(( $b_range - $dhcp_range ))
# Get the gateway
gateway=$(route | grep default | awk '{print $2;}' | head -n1)
gateway=$(ip route | grep default | awk '{print $3;}')
# And the mac adress
hw_adress=$(ifconfig | grep "eth0" | awk '{print $5;}')
hw_adress=$(ip link | grep -A1 "$main_iface" | tail -n1 | awk '{print $2;}')
# Copy the config file
cp "../conf/02-pihole-dhcp.conf" "/etc/dnsmasq.d/"

View file

@ -150,9 +150,9 @@ ynh_replace_string "^cache-size=" "#pihole# cache-size=" /etc/dnsmasq.conf
#=================================================
# Trouve l'interface réseau par défaut
main_iface=$(route | grep default | awk '{print $8;}' | head -n1)
main_iface=$(ip route | grep default | awk '{print $5;}')
# Trouve l'ipv4 associée à l'interface trouvée
localipv4=$(ifconfig | grep -A 1 "$main_iface" | tail -1 | awk '{print $2;}' | cut -d: -f2)
localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1)
# Liste les domaines de yunohost
while read perdomain

View file

@ -165,7 +165,7 @@ setupVars="$pihole_storage/setupVars.conf"
ynh_backup_if_checksum_is_different "$setupVars" # Créé un backup du fichier de config si il a été modifié.
# Trouve l'interface réseau par défaut
main_iface=$(route | grep default | awk '{print $8;}' | head -n1)
main_iface=$(ip route | grep default | awk '{print $5;}')
echo "PIHOLE_INTERFACE=$main_iface" > $setupVars
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
echo "IPV6_ADDRESS=" >> $setupVars