1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/network/tasks/netwarn.yml

38 lines
1.2 KiB
YAML
Raw Normal View History

# mate desktop detection based on 'register: nd_dir' in enable_services
- name: Does /usr/share/mate/autostart/ exist?
stat:
path: /usr/share/mate/autostart/
register: mate_dir
# contents work with mate as of 'switch to using dash via sh'
# 'text' is up for debate other structural changes I do not recommend JV
- name: 'Install from template: /usr/local/sbin/netwarn'
file:
src: netwarn/netwarn
dest: /usr/local/sbin/
mode: 0755
when: mate_dir.stat.exists and mate_dir.stat.isdir
- name: 'Install from template: /usr/share/mate/autostart/netwarn-iiab-network.desktop'
file:
src: netwarn/netwarn-iiab-network.desktop
dest: /usr/share/mate/autostart/
when: mate_dir.stat.exists and mate_dir.stat.isdir
- name: Does /etc/xdg/lxsession/LXDE-pi/autostart exist?
stat:
path: /etc/xdg/lxsession/LXDE-pi/autostart
register: lxde_pi_autostart_present
- name: If so, add /usr/local/sbin/netwarn to /etc/xdg/lxsession/LXDE-pi/autostart
lineinfile:
path: /etc/xdg/lxsession/LXDE-pi/autostart
regexp: '^/usr/local/sbin/netwarn$'
line: '/usr/local/sbin/netwarn'
when: lxde_pi_autostart_present.stat.exists
# 2022-07-21: Is autostart pop-up logic for Mint & stock Ubuntu much the same?