[RFC][PATCH] wpa-supplicant: add capability to run action script directly

John Spencer maillist-hostap at barfooze.de
Thu Nov 27 07:59:04 EST 2014


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).

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: wpa_supplicant-action_script.patch
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20141127/13fd775b/attachment.asc>


More information about the HostAP mailing list