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:
|
#- debug:
|
||||||
# var: nd_enabled
|
# var: nd_enabled
|
||||||
|
|
||||||
#- name: Check if /etc/networkd-dispatcher/routable.d exists
|
- name: Check if /etc/networkd-dispatcher/routable.d exists
|
||||||
# stat:
|
stat:
|
||||||
# path: /etc/networkd-dispatcher/routable.d
|
path: /etc/networkd-dispatcher/routable.d
|
||||||
# register: nd_dir
|
register: nd_dir
|
||||||
|
|
||||||
#- debug:
|
#- debug:
|
||||||
# var: nd_dir
|
# 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 or later)
|
||||||
#- 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:
|
||||||
# template:
|
src: roles/network/templates/network/dnsmasq.sh.j2
|
||||||
# src: roles/network/templates/network/dnsmasq.sh.j2
|
dest: /etc/networkd-dispatcher/routable.d/dnsmasq.sh
|
||||||
# dest: /etc/networkd-dispatcher/routable.d/dnsmasq.sh
|
mode: 0755
|
||||||
# mode: 0755
|
owner: root
|
||||||
# owner: root
|
group: 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_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 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")
|
#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
|
if [ "$interface" = "wlan0" ]; then
|
||||||
REASON="$reason"
|
REASON="$reason"
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
if [ "$IFACE" == "{{ iiab_lan_iface }}" ]; then
|
if [ "$IFACE" == "{{ iiab_lan_iface }}" ]; then
|
||||||
echo "Restarting dnsmasq in 5 seconds"
|
echo "Restarting dnsmasq in 5 seconds"
|
||||||
/bin/sleep 5 && /bin/systemctl --no-block restart dnsmasq.service
|
/bin/sleep 5 && /bin/systemctl --no-block restart dnsmasq.service
|
||||||
echo "Restarting dnsmasq"
|
echo "Restarted dnsmasq"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue