diff --git a/package/feature-wifi/mesh-action.sh b/package/feature-wifi/mesh-action.sh new file mode 100755 index 00000000..a6b40ea0 --- /dev/null +++ b/package/feature-wifi/mesh-action.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# mesh-action.sh - wpa_cli action script for 802.11s mesh +# Called by wpa_cli with: $1=" " + +IFACE="${1%% *}" +EVENT="${1#* }" + +case "$EVENT" in +MESH-GROUP-STARTED*) + if [ -f "/run/mesh-params-${IFACE}.conf" ]; then + . "/run/mesh-params-${IFACE}.conf" + fi + ;; +esac diff --git a/package/feature-wifi/mesh-post.sh b/package/feature-wifi/mesh-post.sh new file mode 100644 index 00000000..5d19856c --- /dev/null +++ b/package/feature-wifi/mesh-post.sh @@ -0,0 +1,11 @@ +#!/bin/sh +IFACE="$1" +CTRL="/run/wpa_supplicant/$IFACE" + +i=0 +while [ $i -lt 10 ] && [ ! -S "$CTRL" ]; do + sleep 1 + i=$((i + 1)) +done + +[ -S "$CTRL" ] && wpa_cli -i "$IFACE" -a /usr/libexec/mesh-action.sh -B