diff options
-rw-r--r-- | user/wpa_supplicant/APKBUILD | 8 | ||||
-rw-r--r-- | user/wpa_supplicant/wpa_cli.sh | 36 |
2 files changed, 26 insertions, 18 deletions
diff --git a/user/wpa_supplicant/APKBUILD b/user/wpa_supplicant/APKBUILD index 0b070dee7..0208adaee 100644 --- a/user/wpa_supplicant/APKBUILD +++ b/user/wpa_supplicant/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=wpa_supplicant pkgver=2.6 -pkgrel=9 +pkgrel=10 pkgdesc="Utility providing key negotiation for WPA wireless networks" url="https://w1.fi/wpa_supplicant/" arch="all" @@ -90,6 +90,10 @@ package() { "$pkgdir"/etc/init.d/wpa_supplicant install -Dm644 "$srcdir"/wpa_supplicant.confd \ "$pkgdir"/etc/conf.d/wpa_supplicant + + # work around netifrc braindamage + mkdir -p "$pkgdir"/bin + ln -s ../sbin/wpa_cli "$pkgdir"/bin/wpa_cli } wpa_gui() { @@ -113,4 +117,4 @@ fc84edd8b30305cc42053c872554098f3f077292ec980ed6a442f37884087ff2f055738fd55977ed 29103161ec2b9631fca9e8d9a97fafd60ffac3fe78cf613b834395ddcaf8be1e253c22e060d7d9f9b974b2d7ce794caa932a2125e29f6494b75bce475f7b30e1 wpa_supplicant.confd 2be055dd1f7da5a3d8e79c2f2c0220ddd31df309452da18f290144d2112d6dbde0fc633bb2ad02c386a39d7785323acaf5f70e5969995a1e8303a094eb5fe232 eloop.patch 6707991f9a071f2fcb09d164d31d12b1f52b91fbb5574b70b8d6f9727f72bbe42b03dd66d10fcc2126f5b7e49ac785657dec90e88b4bf54a9aa5638582f6e505 config -44d33cfe419cdb65cc14f2ac05aa9f8a1b9f2f432181e498071e41ef835662db1e4c5142adf4cfab2475e7b606696169936bd159d1d711f803322db93f242361 wpa_cli.sh" +45d3e70c47d0f7d6dc6730853af8cbcb40ed0713ee7b1069698f5a635939f273f66e72d4221e064c3c71a92154cf07841c8c0d4fc14d796dbb6fe0d92776ee2b wpa_cli.sh" diff --git a/user/wpa_supplicant/wpa_cli.sh b/user/wpa_supplicant/wpa_cli.sh index 0a5a6cc03..ee80e76e9 100644 --- a/user/wpa_supplicant/wpa_cli.sh +++ b/user/wpa_supplicant/wpa_cli.sh @@ -1,33 +1,37 @@ #!/bin/sh # Distributed under the terms of the BSD License. -# Copyright (c) 2015 Sören Tempel <soeren+alpine@soeren-tempel.net> +# Copyright 1999-2011 Gentoo Foundation +# Written by Roy Marples <uberlord@gentoo.org> +# Copyright 2018 Adélie Linux. -IFUP="/sbin/ifup" -IFDOWN="/sbin/ifdown" - -if [ -z "${1}" -o -z "${2}" ]; then - logger -t wpa_cli "this script should be called from wpa_cli(8)" - exit 1 -elif ! [ -x "${IFUP}" -a -x "${IFDOWN}" ]; then - logger -t wpa_cli "${IFUP} or ${IFDOWN} doesn't exist" +if [ -z "$1" -o -z "$2" ]; then + logger -t wpa_cli "Insufficient parameters" exit 1 fi -IFNAME="${1}" -ACTION="${2}" +INTERFACE="$1" +ACTION="$2" + +EXEC="/etc/init.d/net.${INTERFACE} --quiet" -EXEC="" case "${ACTION}" in CONNECTED) - EXEC="${IFUP}" + EXEC="${EXEC} start" ;; DISCONNECTED) - EXEC="${IFDOWN}" + # Deactivated, since stopping /etc/init.d/net.wlanX + # stops the network completly. + EXEC="false ${EXEC} stop" ;; *) - logger -t wpa_cli "unknown action '${ACTION}'" + logger -t wpa_cli "Unknown action '${ACTION}'" exit 1 + ;; esac +# netifrc 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 ${IFNAME} ${ACTION}" -${EXEC} "${IFNAME}" || logger -t wpa_cli "executing '${EXEC}' failed" +${EXEC} || logger -t wpa_cli "executing '${EXEC}' failed" |