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

keep dns_over_https as a bash boolean

This commit is contained in:
Kay0u 2022-01-06 17:56:32 +01:00
parent b86d4225ce
commit 012111f53b
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
3 changed files with 10 additions and 14 deletions

View file

@ -32,10 +32,8 @@ dns_over_https=$(ynh_app_setting_get --app=$app --key=dns_over_https)
if [ -n "$dns_over_https" ] && [ "$dns_over_https" == "1" ];
then
dns_over_https="true"
ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https
else
dns_over_https="false"
ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https
fi
ipv4_route_output=$(echo "$(ip -4 route get 1.2.3.4 2> /dev/null)" | head -n1)

View file

@ -49,13 +49,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
if [ "$dns_over_https" == "1" ];
then
dns_over_https="true"
else
dns_over_https="false"
fi
ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https
#=================================================
@ -171,6 +164,14 @@ for i in $(seq "$(echo $ipv6_route_output | wc -w)" -1 1); do
fi
done
if [ "$dns_over_https" == "1" ];
then
dns_over_https="true"
else
dns_over_https="false"
fi
# Main config File
ynh_add_config --template="../conf/AdGuardHome.yaml" --destination="$final_path/AdGuardHome.yaml"

View file

@ -43,12 +43,9 @@ if ! ynh_permission_exists --permission="api"; then
ynh_permission_create --permission="api" --label="api" --url="re:$domain/dns-query" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true"
fi
if [ -n "$dns_over_https" ] && [ "$dns_over_https" == "1" ];
if [ -z "$dns_over_https" ];
then
dns_over_https="true"
ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https
else
dns_over_https="false"
dns_over_https="0"
ynh_app_setting_set --app=$app --key=dns_over_https --value=$dns_over_https
fi