|
@@ -16,13 +16,15 @@ pending_conf=$4/../dnsmasq
|
|
|
dnsmasq_dir="${pending_conf}/etc/dnsmasq.d"
|
|
dnsmasq_dir="${pending_conf}/etc/dnsmasq.d"
|
|
|
mkdir -p "$dnsmasq_dir"
|
|
mkdir -p "$dnsmasq_dir"
|
|
|
|
|
|
|
|
|
|
+main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}')
|
|
|
|
|
+
|
|
|
cp -a "/etc/.pihole/advanced/01-pihole.conf" "$dnsmasq_dir/"
|
|
cp -a "/etc/.pihole/advanced/01-pihole.conf" "$dnsmasq_dir/"
|
|
|
|
|
|
|
|
ynh_replace_string --match_string="@DNS1@" --replace_string="" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
ynh_replace_string --match_string="@DNS1@" --replace_string="" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
|
ynh_replace_string --match_string="@DNS2@" --replace_string="" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
ynh_replace_string --match_string="@DNS2@" --replace_string="" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
|
ynh_replace_string --match_string="^no-resolv" --replace_string="#no-resolv" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
ynh_replace_string --match_string="^no-resolv" --replace_string="#no-resolv" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
|
ynh_replace_string --match_string="@INT@" --replace_string="$main_iface" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
ynh_replace_string --match_string="@INT@" --replace_string="$main_iface" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
|
-ynh_replace_string --match_string="@cache-size@" --replace_string="1000" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
|
|
|
|
|
+ynh_replace_string --match_string="@CACHE_SIZE@" --replace_string="1000" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
|
query_logging=$(ynh_app_setting_get --app=$app --key=query_logging)
|
|
query_logging=$(ynh_app_setting_get --app=$app --key=query_logging)
|
|
|
if [ "$query_logging" = "true" ]; then
|
|
if [ "$query_logging" = "true" ]; then
|
|
|
ynh_replace_string --match_string="^#log-queries" --replace_string="log-queries" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
ynh_replace_string --match_string="^#log-queries" --replace_string="log-queries" --target_file="$dnsmasq_dir/01-pihole.conf"
|
|
@@ -48,7 +50,6 @@ if [ $enable_dhcp -eq 1 ]
|
|
|
then
|
|
then
|
|
|
|
|
|
|
|
# Get the default network interface
|
|
# Get the default network interface
|
|
|
- main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}')
|
|
|
|
|
# Find the IP associated to the network interface
|
|
# Find the IP associated to the network interface
|
|
|
localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1)
|
|
localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1)
|
|
|
|
|
|