3
# Buyer beware! This is really only useful if you want to use
4
# wpasupplicant in roaming mode.
6
# PLEASE READ /usr/share/doc/wpasupplicant/README.modes for
7
# details of the modes of operation of wpasupplicant.
10
# To activate the wpasupplicant daemon, set ENABLE_ROAMING_MODE to 1
14
# Location of the wpa_supplicant.conf configuration file to be used
17
# See the wpa_supplicant.conf(5) manpage for detailed information
18
# about the wpa_supplicant configuration file. Example configuration
19
# files are located at /usr/share/doc/wpasupplicant/examples.
21
# Failure to set CONFIG to the full pathname of your configuration
22
# file will cause the daemon to exit immediately.
26
# Specify the network interface that the daemon will attach to.
28
# Examples: INTERFACE="eth1"
31
# Failure to set INTERFACE to a valid network interface name will
32
# cause the daemon to fail or exit immediately.
36
# DRIVER specifies the driver type of the interface defined above.
38
# If DRIVER is not set, the daemon will default to the "wext" driver
40
# Currently, the following drivers are supported:
41
# hostap = Host AP driver (Intersil Prism2/2.5/3)
42
# madwifi = MADWIFI 802.11 support (Atheros, etc.)
43
# atmel = ATMEL AT76C5XXx (USB, PCMCIA)
44
# wext = Linux wireless extensions (generic, ipw2100/2200/3495, linux >= 2.6.14)
45
# ndiswrapper = Linux ndiswrapper
46
# ipw = Intel ipw2100/2200 driver (linux kernels 2.6.13 or older only)
47
# wired = wpa_supplicant wired Ethernet driver
51
# End user defined section
53
PATH=/sbin:/bin:/usr/sbin:/usr/bin
55
DAEMON="/sbin/wpa_supplicant"
56
PNAME="wpa_supplicant"
58
# exit silently if daemon is not installed/executable
59
[ -x $DAEMON ] || exit 0
61
if [ "$ENABLE_ROAMING_MODE" = "0" ]; then
65
if [ -z "$INTERFACE" ]; then
66
echo "No INTERFACE was defined, not starting.";
70
if [ ! -r "$CONFIG" ]; then
71
echo "No configuration file found, not starting.";
75
if [ -z "$DRIVER" ]; then
79
# the pidfile name is important for avoiding unwanted interactions
80
# with the wpasupplicant pre-up script
81
PIDFILE="/var/run/wpa_supplicant.$INTERFACE.pid"
83
OPTIONS="-B -w -i $INTERFACE -D $DRIVER -c $CONFIG -P $PIDFILE"
89
if [ -f "$PIDFILE" ]; then
90
echo "$PNAME not starting, $PIDFILE already exists."
93
echo "Starting $PNAME."
94
start-stop-daemon --start --name $PNAME \
95
--oknodo --startas $DAEMON -- $OPTIONS
98
echo "Stopping $PNAME."
99
start-stop-daemon --stop --name $PNAME \
101
if [ -f "$PIDFILE" ]; then
106
echo "Reloading $PNAME."
107
start-stop-daemon --stop --signal HUP \
111
echo "Stopping $PNAME."
112
start-stop-daemon --stop --name $PNAME \
114
if [ -f "$PIDFILE" ]; then
118
echo "Starting $PNAME."
119
start-stop-daemon --start --name $PNAME \
120
--oknodo --startas $DAEMON -- $OPTIONS
123
echo "Usage: wpasupplicant {start|stop|restart|reload|force-reload}" >&2