Date: Thu, 27 Nov 2014 13:59:04 +0100
From: John Spencer <maillist-hostap@...fooze.de>
To: hostap@...ts.shmoo.com
CC: sabotage@...ts.openwall.com
Subject: [RFC][PATCH] wpa-supplicant: add capability to run action script
directly
Instead of having to run wpa_cli as a service to be able to execute an
action script on CONNECT/DISCONNECT events (for the purpose of being
able to get a DHCP address or assign one manually), it is much simpler
and less resource-consuming to just run the action script directly from
wpa_supplicant, which runs anyway.
The dbus functionality is no option either as it requires running a
daemon permanently as well (plus dbus may not even be installed, as is
the case on sabotage linux).
The action script pathname is specified via a action_script variable in
the global section of wpa_supplicant.conf
example action script:
.#!/bin/sh
itf="$1"
state="$2"
case "$state" in
CONNECTED) dhclient "$itf" ;;
DISCONNECTED) ifconfig "$itf" down ;;
esac
Please note that the code to pass the SSID of the connected wifi as a
third parameter doesn't seem to work atm (only passes an empty string).
View attachment "wpa_supplicant-action_script.patch" of type "text/plain" (2740 bytes)