1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/adguardhome_ynh.git synced 2024-09-03 18:06:23 +02:00
This commit is contained in:
OniriCorpe 2023-12-31 01:19:22 +01:00
parent a7ddbdeae2
commit 4181ed6204
2 changed files with 6 additions and 2 deletions

View file

@ -2,7 +2,7 @@ version = "1.0"
[main] [main]
name = "AdGuard Home configuration" name = "AdGuard Home configuration"
help = "If any trouble or question, please refer to [the package's admin docs](https://github.com/YunoHost-Apps/adguardhome_ynh/blob/master/doc/ADMIN.md)!" help = "If any trouble or question, please refer to the admin documentation right below!"
services = ["__APP__"] services = ["__APP__"]
[main.options.open_port_53] [main.options.open_port_53]

View file

@ -76,7 +76,7 @@ process_ips(){
for i in $(seq "$(echo "$ips" | wc -w)" -1 1); do for i in $(seq "$(echo "$ips" | wc -w)" -1 1); do
ip=$(echo "$ips" | awk "{print \$$i}") ip=$(echo "$ips" | awk "{print \$$i}")
# check if the so-called IP really is one # check if the so-called IP really is one
if [[ $(ynh_validate_ip4 --ip_address="$ip") || $(ynh_validate_ip6 --ip_address="$ip") ]] ; then if [ "$(ynh_validate_ip4 --ip_address="$ip")" ] || [ "$(ynh_validate_ip6 --ip_address="$ip")" ] ; then
# don't process if the IP is public and the port 53 closed # don't process if the IP is public and the port 53 closed
if [ "$(is_public_ip "$ip")" == 0 ] && [ "$open_port_53" == "false" ] ; then if [ "$(is_public_ip "$ip")" == 0 ] && [ "$open_port_53" == "false" ] ; then
exit 1 exit 1
@ -92,6 +92,10 @@ process_ips(){
update_agh_ip_config(){ update_agh_ip_config(){
# used to update the IP adresses in the AGHconfig file # used to update the IP adresses in the AGHconfig file
if [ -z "${ipv4_addr:-}" ] && [ -z "${ipv6_addr:-}" ]; then
ynh_die --message="At leat one IP adress is required to run AdGuard Home. Please report this error."
fi
# use python's yaml and open the AGH config file # use python's yaml and open the AGH config file
python3 -c "import yaml python3 -c "import yaml
with open(\"$install_dir/AdGuardHome.yaml\", 'r') as file: with open(\"$install_dir/AdGuardHome.yaml\", 'r') as file: