mirror of
https://github.com/YunoHost-Apps/pihole_ynh.git
synced 2024-09-03 20:05:58 +02:00
Fix missing ports
This commit is contained in:
parent
d98ea5d8eb
commit
f385b79539
3 changed files with 23 additions and 16 deletions
|
@ -78,6 +78,9 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
ynh_exec_fully_quiet yunohost firewall disallow Both 53 --no-reload
|
ynh_exec_fully_quiet yunohost firewall disallow Both 53 --no-reload
|
||||||
ynh_exec_fully_quiet yunohost firewall allow Both 53 --no-upnp
|
ynh_exec_fully_quiet yunohost firewall allow Both 53 --no-upnp
|
||||||
|
|
||||||
|
# Open the UDP port 67 for dhcp
|
||||||
|
ynh_exec_fully_quiet yunohost firewall allow UDP 67 --no-upnp
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -292,14 +295,6 @@ do
|
||||||
echo "$localipv4 $perdomain #Added by pihole#" >> /etc/hosts
|
echo "$localipv4 $perdomain #Added by pihole#" >> /etc/hosts
|
||||||
done <<< "$(yunohost domain list | grep "\." | sed 's/.*: \|.*- //')"
|
done <<< "$(yunohost domain list | grep "\." | sed 's/.*: \|.*- //')"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# ENABLE DHCP SERVER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Enabling DHCP server..." --weight=1
|
|
||||||
|
|
||||||
# Open the UDP port 67 for dhcp
|
|
||||||
ynh_exec_fully_quiet yunohost firewall allow UDP 67 --no-upnp
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SET VERSIONS FOR THE FOOTER OF THE WEB INTERFACE
|
# SET VERSIONS FOR THE FOOTER OF THE WEB INTERFACE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -47,6 +47,26 @@ ynh_script_progression --message="Validating restoration parameters..." --weight
|
||||||
test ! -d $final_path \
|
test ! -d $final_path \
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|| ynh_die --message="There is already a directory: $final_path "
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# FIND AND OPEN A PORT
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Finding an available port..." --weight=12
|
||||||
|
|
||||||
|
# Find an available port
|
||||||
|
port=$(ynh_find_port --port=4711)
|
||||||
|
if [ $port -gt 4720 ]
|
||||||
|
then
|
||||||
|
ynh_die --message="The ports 4711 to 4720 are already in use. Pi-hole can't work on another port. Please try to free one of these ports."
|
||||||
|
fi
|
||||||
|
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
|
|
||||||
|
# Disable the port 53 for upnp
|
||||||
|
ynh_exec_fully_quiet yunohost firewall disallow Both 53 --no-reload
|
||||||
|
ynh_exec_fully_quiet yunohost firewall allow Both 53 --no-upnp
|
||||||
|
|
||||||
|
# Open the UDP port 67 for dhcp
|
||||||
|
ynh_exec_fully_quiet yunohost firewall allow UDP 67 --no-upnp
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ACTIVATE MAINTENANCE MODE
|
# ACTIVATE MAINTENANCE MODE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -362,14 +362,6 @@ do
|
||||||
echo "$localipv4 $perdomain #Added by pihole#" >> /etc/hosts
|
echo "$localipv4 $perdomain #Added by pihole#" >> /etc/hosts
|
||||||
done <<< "$(yunohost domain list | grep "\." | sed 's/.*: \|.*- //')"
|
done <<< "$(yunohost domain list | grep "\." | sed 's/.*: \|.*- //')"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# ENABLE DHCP SERVER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Enabling DHCP server..." --weight=1
|
|
||||||
|
|
||||||
# Open the UDP port 67 for dhcp
|
|
||||||
ynh_exec_fully_quiet yunohost firewall allow UDP 67 --no-upnp
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SET VERSIONS FOR THE FOOTER OF THE WEB INTERFACE
|
# SET VERSIONS FOR THE FOOTER OF THE WEB INTERFACE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue