]> git.ipfire.org Git - people/stevee/network.git/commitdiff
802.11s: Write WPA supplicant configuration
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Aug 2017 21:53:50 +0000 (21:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Aug 2017 21:53:50 +0000 (21:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/hooks/ports/wireless-mesh

index 1a4c04ed5d3ef0b02fec4b43b1a591105a5ccd40..a3f07bb8b5f9170dd43da5770198f01e4dee56ba 100644 (file)
@@ -102,6 +102,17 @@ hook_create() {
                        --type="mesh-point" || return $?
        fi
 
+       # Write WPA supplicant configuration
+       local config_file="$(wpa_supplicant_config_dir "${port}")/wpa_supplicant.conf"
+
+       wpa_supplicant_config_write \
+               "${port}" \
+               "${config_file}" \
+               --channel="${CHANNEL}" \
+               --key="${PSK}" \
+               --mode="802.11s" \
+               --ssid="${MESH_ID}" || return $?
+
        return ${EXIT_OK}
 }
 
@@ -116,6 +127,19 @@ hook_remove() {
        exit ${EXIT_OK}
 }
 
+hook_up() {
+       local port="${1}"
+
+       # Start WPA supplicant
+       wpa_supplicant_start "${port}"
+}
+
+hook_down() {
+       local port="${1}"
+
+       wpa_supplicant_stop "${port}"
+}
+
 hook_hotplug() {
        local port="${1}"
        assert isset port