mirror of
https://github.com/YunoHost-Apps/pihole_ynh.git
synced 2024-09-03 20:05:58 +02:00
Fix #37
This commit is contained in:
parent
a4a720a9e8
commit
3b7e0608c4
4 changed files with 4 additions and 4 deletions
|
@ -41,7 +41,7 @@ if [ "$file" = "setupVars.conf" ]
|
|||
then
|
||||
# Recreate the default config
|
||||
# Trouve l'interface réseau par défaut
|
||||
main_iface=$(ip route | grep default | awk '{print $5;}')
|
||||
main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}')
|
||||
echo "PIHOLE_INTERFACE=$main_iface" > "$config_file"
|
||||
echo "IPV4_ADDRESS=127.0.0.1" >> "$config_file"
|
||||
echo "IPV6_ADDRESS=" >> "$config_file"
|
||||
|
|
|
@ -197,7 +197,7 @@ ynh_exec_warn_less systemctl enable pihole-FTL
|
|||
setupVars="$pihole_storage/setupVars.conf"
|
||||
|
||||
# Get the default network interface
|
||||
main_iface=$(ip route | grep default | awk '{print $5;}')
|
||||
main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}')
|
||||
echo "PIHOLE_INTERFACE=$main_iface" > $setupVars
|
||||
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
|
||||
echo "IPV6_ADDRESS=" >> $setupVars
|
||||
|
|
|
@ -150,7 +150,7 @@ ynh_replace_string "^cache-size=" "#pihole# cache-size=" /etc/dnsmasq.conf
|
|||
#=================================================
|
||||
|
||||
# Get the default network interface
|
||||
main_iface=$(ip route | grep default | awk '{print $5;}')
|
||||
main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}')
|
||||
# Find the IP associated to the network interface
|
||||
localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1)
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ then
|
|||
ynh_backup_if_checksum_is_different "$setupVars"
|
||||
|
||||
# Get the default network interface
|
||||
main_iface=$(ip route | grep default | awk '{print $5;}')
|
||||
main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}')
|
||||
echo "PIHOLE_INTERFACE=$main_iface" > $setupVars
|
||||
echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars
|
||||
echo "IPV6_ADDRESS=" >> $setupVars
|
||||
|
|
Loading…
Add table
Reference in a new issue