diff options
author | Henrik Brix Andersen <brix@gentoo.org> | 2006-03-20 08:16:34 +0000 |
---|---|---|
committer | Henrik Brix Andersen <brix@gentoo.org> | 2006-03-20 08:16:34 +0000 |
commit | 7ba7275963306bc79e7a3dca9d9806552efbd69d (patch) | |
tree | a4dafb1d02abf07ded8d6e5e906df0243cb8198a /net-wireless/wpa_supplicant/files/wpa_supplicant-0.5.2-wpa_cli.sh | |
parent | Use USE=iontruetype rather than USE=truetype to enable XFT support at request... (diff) | |
download | historical-7ba7275963306bc79e7a3dca9d9806552efbd69d.tar.gz historical-7ba7275963306bc79e7a3dca9d9806552efbd69d.tar.bz2 historical-7ba7275963306bc79e7a3dca9d9806552efbd69d.zip |
New development snapshot.
Package-Manager: portage-2.0.54
Diffstat (limited to 'net-wireless/wpa_supplicant/files/wpa_supplicant-0.5.2-wpa_cli.sh')
-rw-r--r-- | net-wireless/wpa_supplicant/files/wpa_supplicant-0.5.2-wpa_cli.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/net-wireless/wpa_supplicant/files/wpa_supplicant-0.5.2-wpa_cli.sh b/net-wireless/wpa_supplicant/files/wpa_supplicant-0.5.2-wpa_cli.sh new file mode 100644 index 000000000000..5d162694a642 --- /dev/null +++ b/net-wireless/wpa_supplicant/files/wpa_supplicant-0.5.2-wpa_cli.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Copyright 1999-2006 Gentoo Foundation +# Written by Roy Marples <uberlord@gentoo.org> +# Distributed under the terms of the GNU General Public License v2 +# Alternatively, this file may be distributed under the terms of the BSD License +# $Header: /var/cvsroot/gentoo-x86/net-wireless/wpa_supplicant/files/wpa_supplicant-0.5.2-wpa_cli.sh,v 1.1 2006/03/20 08:16:34 brix Exp $ + +if [ -z "$1" -o -z "$2" ]; then + echo "Insufficient parameters" > /dev/stderr + exit 1 +fi + +INTERFACE="$1" +ACTION="$2" + +# Note, the below action must NOT mark the interface down via ifconfig, ip or +# similar. Addresses can be removed, changed and daemons can be stopped, but +# the interface must remain up for wpa_supplicant to work. + +if [ -f /etc/gentoo-release ]; then + EXEC="/etc/init.d/net.${INTERFACE} --quiet" +else + echo "I don't know what to do with this distro!" > /dev/stderr + exit 1 +fi + +case ${ACTION} in + CONNECTED) + EXEC="${EXEC} start" + ;; + DISCONNECTED) + EXEC="${EXEC} stop" + ;; + *) + echo "Unknown action ${ACTION}" > /dev/stderr + exit 1 + ;; +esac + +# ${EXEC} can use ${IN_BACKGROUND} so that it knows that the user isn't +# stopping the interface and a background process - like wpa_cli - is. +export IN_BACKGROUND=true + +${EXEC} |