2 # Copyright 1999-2006 Gentoo Foundation
3 # Written by Roy Marples <uberlord@gentoo.org>
4 # Distributed under the terms of the GNU General Public License v2
5 # Alternatively, this file may be distributed under the terms of the BSD License
6 # $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/files/wpa_cli.sh,v 1.1 2006/07/11 15:07:16 uberlord Exp $
8 if [ -z "$1" -o -z "$2" ]; then
9 logger
-t wpa_cli
"Insufficient parameters"
16 # Note, the below action must NOT mark the interface down via ifconfig, ip or
17 # similar. Addresses can be removed, changed and daemons can be stopped, but
18 # the interface must remain up for wpa_supplicant to work.
20 if [ -f /etc
/gentoo-release
]; then
21 EXEC
="/etc/init.d/net.${INTERFACE} --quiet"
23 logger
-t wpa_cli
"I don't know what to do with this distro!"
35 logger
-t wpa_cli
"Unknown action ${ACTION}"
40 # ${EXEC} can use ${IN_BACKGROUND} so that it knows that the user isn't
41 # stopping the interface and a background process - like wpa_cli - is.
42 export IN_BACKGROUND
=true
44 logger
-t wpa_cli
"interface ${INTERFACE} ${ACTION}"
45 ${EXEC} || logger
-t wpa_cli
"executing '${EXEC}' failed"