diff options
author | 2024-08-01 11:39:13 -0700 | |
---|---|---|
committer | 2024-08-01 11:39:13 -0700 | |
commit | b3040e5f9ac5464ad802d79e3d7843d4ae5b6674 (patch) | |
tree | b1ff2282ffe926504d8f056a5d7ac9b64947db79 | |
parent | net-wireless/wpa_supplicant: add 2.10-r5 (diff) | |
download | libressl-b3040e5f9ac5464ad802d79e3d7843d4ae5b6674.tar.gz libressl-b3040e5f9ac5464ad802d79e3d7843d4ae5b6674.tar.bz2 libressl-b3040e5f9ac5464ad802d79e3d7843d4ae5b6674.zip |
net-wireless/wpa_supplicant: add missing file
Signed-off-by: orbea <orbea@riseup.net>
-rw-r--r-- | net-wireless/wpa_supplicant/files/wpa_cli-r1.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/net-wireless/wpa_supplicant/files/wpa_cli-r1.sh b/net-wireless/wpa_supplicant/files/wpa_cli-r1.sh new file mode 100644 index 0000000..dc852f4 --- /dev/null +++ b/net-wireless/wpa_supplicant/files/wpa_cli-r1.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Copyright 1999-2011 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 + +if [ -z "$1" -o -z "$2" ]; then + logger -t wpa_cli "Insufficient parameters" + 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 + logger -t wpa_cli "I don't know what to do with this distro!" + exit 1 +fi + +case ${ACTION} in + CONNECTED) + EXEC="${EXEC} start" + ;; + DISCONNECTED) + EXEC="${EXEC} --nodeps stop" + ;; + *) + logger -t wpa_cli "Unknown action ${ACTION}" + 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 + +logger -t wpa_cli "interface ${INTERFACE} ${ACTION}" +${EXEC} || logger -t wpa_cli "executing '${EXEC}' failed" |