summaryrefslogtreecommitdiff
path: root/roles/install_fastd
diff options
context:
space:
mode:
Diffstat (limited to 'roles/install_fastd')
-rw-r--r--roles/install_fastd/files/fastd_grep.sh7
-rw-r--r--roles/install_fastd/tasks/main.yml14
2 files changed, 21 insertions, 0 deletions
diff --git a/roles/install_fastd/files/fastd_grep.sh b/roles/install_fastd/files/fastd_grep.sh
new file mode 100644
index 0000000..37f5118
--- /dev/null
+++ b/roles/install_fastd/files/fastd_grep.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+for file in /run/ff*.socket
+do
+ echo $file
+ nc -U $file | jq -r '.peers | keys[] as $k | "\(.[$k] | .connection.mac_addresses[]) \(.[$k] | .address) \($k)"' | grep $1
+done
diff --git a/roles/install_fastd/tasks/main.yml b/roles/install_fastd/tasks/main.yml
index 76bee05..85d6aa2 100644
--- a/roles/install_fastd/tasks/main.yml
+++ b/roles/install_fastd/tasks/main.yml
@@ -39,6 +39,20 @@
mode: 0744
with_items: "{{ sites }}"
+- name: add fastd_grep script
+ copy:
+ src: fastd_grep.sh
+ dest: /root/fastd_grep.sh
+ mode: 0744
+
+- name: install fastd_grep dependencies
+ pacman:
+ name:
+ - openbsd-netcat
+ - jq
+ state: present
+
+
- name: start and enable fastd service
systemd:
name: fastd@ff{{ item.name }}.service