diff --git a/conf/ynh-hotspot-nm.conf b/conf/ynh-hotspot-nm.conf new file mode 100644 index 0000000..f47a8c6 --- /dev/null +++ b/conf/ynh-hotspot-nm.conf @@ -0,0 +1,2 @@ +[keyfile] +unmanaged-devices=interface-name:wl* diff --git a/scripts/install b/scripts/install index 2dd2069..b9f4dd2 100644 --- a/scripts/install +++ b/scripts/install @@ -216,6 +216,11 @@ install -b -o root -g root -m 0644 ../conf/dnsmasq_dhcpdv4.conf.tpl /etc/dnsmasq install -b -o root -g root -m 0644 ../conf/nginx_wifiadmin.conf "/etc/nginx/conf.d/${domain}.d/wifiadmin.conf" install -b -o root -g root -m 0644 ../conf/phpfpm_wifiadmin.conf /etc/php5/fpm/pool.d/wifiadmin.conf +# add config if NetworkManager is installed +if dpkg -s network-manager >/dev/null 2>&1; then + install -b -o root -g root -m 0644 ../conf/ynh-hotspot-nm.conf /etc/NetworkManager/conf.d/ +fi + #================================================= # COPY WEB SOURCES #================================================= @@ -248,9 +253,6 @@ sed 's||/var/www/wifiadmin/|g' -i /etc/php5/fpm/pool.d/wifia # Fix sources sed "s||${path_url}|g" -i /var/www/wifiadmin/config.php -# Fix network interface -grep -q -x -F 'auto wlan0' /etc/network/interfaces || echo 'auto wlan0' >> /etc/network/interfaces - # make sure rfkill does not block the radio rfkill unblock wifi wlan @@ -262,6 +264,11 @@ install -o root -g root -m 0644 ../conf/ynh-hotspot.service /etc/systemd/system/ yunohost firewall allow --no-upnp --ipv6 UDP 547 yunohost firewall allow --no-upnp UDP 67 +# Restart network-manager if it is installed +if dpkg -s network-manager >/dev/null 2>&1; then + systemctl reload network-manager +fi + # Set default inits # The boot order of these services are important, so they are disabled by default # and the ynh-hotspot service handles them. diff --git a/scripts/remove b/scripts/remove index 686375f..a998fb5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -54,6 +54,7 @@ yunohost firewall disallow UDP 67 ynh_secure_remove /etc/dnsmasq.dhcpd/ ynh_secure_remove /etc/nginx/conf.d/${domain}.d/wifiadmin.conf ynh_secure_remove /etc/php5/fpm/pool.d/wifiadmin.conf +ynh_secure_remove /etc/NetworkManager/conf.d/ynh-hotspot-nm.conf for FILE in $(ls /etc/hostapd/hostapd.conf{.tpl?,}) do ynh_secure_remove "$FILE"