mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #2471 from jvonau/no_iiab
RPiOS - use dhcpcd hooks to restart hostapd when br0 appears [for Ubuntu too]
This commit is contained in:
commit
da01e92fff
3 changed files with 18 additions and 14 deletions
|
@ -85,23 +85,22 @@
|
|||
#- debug:
|
||||
# var: nd_enabled
|
||||
|
||||
#- name: Check if /etc/networkd-dispatcher/routable.d exists
|
||||
# stat:
|
||||
# path: /etc/networkd-dispatcher/routable.d
|
||||
# register: nd_dir
|
||||
- name: Check if /etc/networkd-dispatcher/routable.d exists
|
||||
stat:
|
||||
path: /etc/networkd-dispatcher/routable.d
|
||||
register: nd_dir
|
||||
|
||||
#- debug:
|
||||
# var: nd_dir
|
||||
|
||||
#- name: To restart dnsmasq whenever br0 comes up, install /etc/networkd-dispatcher/routable.d/dnsmasq.sh from template (if isn't Appliance, and networkd-dispatcher is enabled, and directory /etc/networkd-dispatcher/routable.d exists, i.e. OS's like Ubuntu 18.04)
|
||||
#- name: To restart dnsmasq whenever br0 comes up, install /etc/networkd-dispatcher/routable.d/dnsmasq.sh from template (if isn't Appliance, and directory /etc/networkd-dispatcher/routable.d exists, i.e. OS's like Ubuntu 18.04)
|
||||
# template:
|
||||
# src: roles/network/templates/network/dnsmasq.sh.j2
|
||||
# dest: /etc/networkd-dispatcher/routable.d/dnsmasq.sh
|
||||
# mode: 0755
|
||||
# owner: root
|
||||
# group: root
|
||||
# when: dnsmasq_install and dnsmasq_enabled and nd_dir.stat.exists and nd_dir.stat.isdir and (iiab_network_mode != "Appliance")
|
||||
- name: To restart dnsmasq whenever br0 comes up, install /etc/networkd-dispatcher/routable.d/dnsmasq.sh from template (if isn't Appliance, and directory /etc/networkd-dispatcher/routable.d exists, i.e. OS's like Ubuntu 18.04 or later)
|
||||
template:
|
||||
src: roles/network/templates/network/dnsmasq.sh.j2
|
||||
dest: /etc/networkd-dispatcher/routable.d/dnsmasq.sh
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
when: dnsmasq_install and dnsmasq_enabled and nd_dir.stat.exists and nd_dir.stat.isdir and (iiab_network_mode != "Appliance")
|
||||
#when: dnsmasq_install and dnsmasq_enabled and nd_enabled is defined and nd_enabled.stdout == "enabled" and nd_dir.stat.exists and nd_dir.stat.isdir and (iiab_network_mode != "Appliance")
|
||||
#when: dnsmasq_install and dnsmasq_enabled and systemd_out.status.UnitFileState == "enabled" and networkd_dir.stat.exists and networkd_dir.stat.isdir and (iiab_network_mode != "Appliance")
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
if [ "$interface" = "br0" ] && [ $if_up = "true" ]; then
|
||||
syslog info "50-iiab IF_UP br0 restarting dnsmasq"
|
||||
sleep 2
|
||||
systemctl --no-block restart dnsmasq
|
||||
fi
|
||||
|
||||
if [ "$interface" = "wlan0" ]; then
|
||||
REASON="$reason"
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
if [ "$IFACE" == "{{ iiab_lan_iface }}" ]; then
|
||||
echo "Restarting dnsmasq in 5 seconds"
|
||||
/bin/sleep 5 && /bin/systemctl --no-block restart dnsmasq.service
|
||||
echo "Restarting dnsmasq"
|
||||
echo "Restarted dnsmasq"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue