1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/adguardhome_ynh.git synced 2024-09-03 18:06:23 +02:00

Fix the config file

This commit is contained in:
Kay0u 2022-01-03 16:09:54 +01:00
parent a67ccd2f81
commit a98d1ff6de
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
3 changed files with 24 additions and 2 deletions

0
check_process Executable file → Normal file
View file

View file

@ -13,7 +13,8 @@ debug_pprof: false
web_session_ttl: 720 web_session_ttl: 720
dns: dns:
bind_hosts: bind_hosts:
- 0.0.0.0 __IPV4_ADDR__
__IPV6_ADDR__
port: __ADGUARD_PORT__ port: __ADGUARD_PORT__
statistics_interval: 1 statistics_interval: 1
querylog_enabled: true querylog_enabled: true

View file

@ -60,7 +60,7 @@ port=$(ynh_find_port --port=3000)
ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=port --value=$port
# Find an available port # Find an available port
adguard_port=$(ynh_find_port --port=53) adguard_port=53
ynh_app_setting_set --app=$app --key=adguard_port --value=$adguard_port ynh_app_setting_set --app=$app --key=adguard_port --value=$adguard_port
# Disable the port 53 for upnp # Disable the port 53 for upnp
@ -116,6 +116,27 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_script_progression --message="Modifying a config file..." --weight=1
ipv4_route_output=$(ip -4 route get 1.2.3.4 | head -n1)
ipv6_route_output=$(ip -6 route get ::1.2.3.4 | head -n1)
ipv4_addr=""
for i in $(seq "$(echo $ipv4_route_output | wc -w)" -1 1); do
ip=$(echo $ipv4_route_output | awk "{print \$$i}")
if ynh_validate_ip4 --ip_address=$ip; then
ipv4_addr="- $ip"
break
fi
done
ipv6_addr=""
for i in $(seq "$(echo $ipv6_route_output | wc -w)" -1 1); do
ip=$(echo $ipv6_route_output | awk "{print \$$i}")
if ynh_validate_ip6 --ip_address=$ip; then
ipv6_addr="- $ip"
break
fi
done
# Main config File # Main config File
ynh_add_config --template="../conf/AdGuardHome.yaml" --destination="$final_path/AdGuardHome.yaml" ynh_add_config --template="../conf/AdGuardHome.yaml" --destination="$final_path/AdGuardHome.yaml"