mirror of
https://github.com/YunoHost-Apps/hotspot_ynh.git
synced 2024-09-03 19:25:53 +02:00
Fix DHCP problem after the system boot
This commit is contained in:
parent
2a195bc33b
commit
56cc7e18a7
2 changed files with 9 additions and 8 deletions
|
@ -131,9 +131,6 @@ set_dhcpd() {
|
|||
sed "s|<TPL:IP4_DNS1>|${ynh_ip4_dns1}|g" -i /etc/dnsmasq.d/dhcpdv4.conf
|
||||
sed "s|<TPL:WIFI_DEVICE>|${ynh_wifi_device}|g" -i /etc/dnsmasq.d/dhcpdv4.conf
|
||||
sed "s|<TPL:IP4_NAT_PREFIX>|${ynh_ip4_nat_prefix}|g" -i /etc/dnsmasq.d/dhcpdv4.conf
|
||||
|
||||
service bind9 stop &> /dev/null
|
||||
service dnsmasq restart
|
||||
}
|
||||
|
||||
start_hostapd() {
|
||||
|
@ -335,17 +332,20 @@ case "$1" in
|
|||
set_forwarding
|
||||
fi
|
||||
|
||||
# Run hostapd
|
||||
if ! is_hostapd_running; then
|
||||
echo "Run hostapd"
|
||||
start_hostapd
|
||||
fi
|
||||
|
||||
# Run DHCP servers
|
||||
if ( has_ip6delegatedprefix && ! is_dhcpdv6_set ) || ! is_dhcpdv4_set; then
|
||||
echo "Set DHCP servers (dnsmasq)"
|
||||
set_dhcpd
|
||||
fi
|
||||
|
||||
# Run hostapd
|
||||
if ! is_hostapd_running; then
|
||||
echo "Run hostapd"
|
||||
start_hostapd
|
||||
fi
|
||||
service bind9 stop &> /dev/null
|
||||
service dnsmasq restart
|
||||
|
||||
# Update dynamic settings
|
||||
moulinette_set internet_device "${new_internet_device}"
|
||||
|
|
|
@ -57,6 +57,7 @@ fi
|
|||
|
||||
# Install packages
|
||||
packages='php5-fpm sipcalc hostapd iptables wireless-tools dnsmasq'
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Packaged USB Wireless Device firmwares
|
||||
# Based on https://wiki.debian.org/WiFi#USB_Devices
|
||||
|
|
Loading…
Reference in a new issue