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:
parent
09329575a4
commit
2b837769ec
5 changed files with 15 additions and 8 deletions
|
@ -1,7 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Dependencies
|
# 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
|
if [ "$(lsb_release --codename --short)" != "jessie" ]; then
|
||||||
app_depencencies="$app_depencencies php-sqlite3"
|
app_depencencies="$app_depencencies php-sqlite3"
|
||||||
else
|
else
|
||||||
|
|
|
@ -21,6 +21,12 @@ new_path=$YNH_APP_NEW_PATH
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# LOAD SETTINGS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK THE SYNTAX OF THE PATHS
|
# CHECK THE SYNTAX OF THE PATHS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -188,7 +188,7 @@ ynh_exec_warn_less systemctl enable pihole-FTL
|
||||||
setupVars="$pihole_storage/setupVars.conf"
|
setupVars="$pihole_storage/setupVars.conf"
|
||||||
|
|
||||||
# Trouve l'interface réseau par défaut
|
# 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 "PIHOLE_INTERFACE=$main_iface" > $setupVars
|
||||||
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
|
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
|
||||||
echo "IPV6_ADDRESS=" >> $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
|
# 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
|
# Liste les domaines de yunohost
|
||||||
while read perdomain
|
while read perdomain
|
||||||
|
@ -268,9 +268,9 @@ then
|
||||||
a_range=$(( $b_range - $dhcp_range ))
|
a_range=$(( $b_range - $dhcp_range ))
|
||||||
|
|
||||||
# Get the gateway
|
# Get the gateway
|
||||||
gateway=$(route | grep default | awk '{print $2;}' | head -n1)
|
gateway=$(ip route | grep default | awk '{print $3;}')
|
||||||
# And the mac adress
|
# 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
|
# Copy the config file
|
||||||
cp "../conf/02-pihole-dhcp.conf" "/etc/dnsmasq.d/"
|
cp "../conf/02-pihole-dhcp.conf" "/etc/dnsmasq.d/"
|
||||||
|
|
|
@ -150,9 +150,9 @@ ynh_replace_string "^cache-size=" "#pihole# cache-size=" /etc/dnsmasq.conf
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Trouve l'interface réseau par défaut
|
# 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
|
# 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
|
# Liste les domaines de yunohost
|
||||||
while read perdomain
|
while read perdomain
|
||||||
|
|
|
@ -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é.
|
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
|
# 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 "PIHOLE_INTERFACE=$main_iface" > $setupVars
|
||||||
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
|
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
|
||||||
echo "IPV6_ADDRESS=" >> $setupVars
|
echo "IPV6_ADDRESS=" >> $setupVars
|
||||||
|
|
Loading…
Add table
Reference in a new issue