aircrack-ng: remove root requirement for the OUI update script

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Jonathan Beezley 2012-06-11 09:50:28 -06:00 committed by Adam Vandenberg
parent 8450526d9b
commit 5f13a1212d

View file

@ -1,9 +1,15 @@
require 'formula'
class AircrackNg < Formula
url 'http://download.aircrack-ng.org/aircrack-ng-1.1.tar.gz'
md5 'f7a24ed8fad122c4187d06bfd6f998b4'
homepage 'http://aircrack-ng.org/'
url 'http://download.aircrack-ng.org/aircrack-ng-1.1.tar.gz'
sha1 ''
# Remove root requirement from OUI update script. See:
# https://github.com/mxcl/homebrew/pull/12755
def patches
DATA
end
def install
# Force i386, otherwise you get errors:
@ -24,8 +30,38 @@ class AircrackNg < Formula
end
def caveats; <<-EOS.undent
Run `airodump-ng-oui-update` as root (or with sudo) to install or update
the Airodump-ng OUI file.
Run `airodump-ng-oui-update` install or update the Airodump-ng OUI file.
EOS
end
end
__END__
--- a/scripts/airodump-ng-oui-update
+++ b/scripts/airodump-ng-oui-update
@@ -7,25 +7,6 @@
OUI_PATH="/usr/local/etc/aircrack-ng"
AIRODUMP_NG_OUI="${OUI_PATH}/airodump-ng-oui.txt"
OUI_IEEE="${OUI_PATH}/oui.txt"
-USERID=""
-
-
-# Make sure the user is root
-if [ x"`which id 2> /dev/null`" != "x" ]
-then
- USERID="`id -u 2> /dev/null`"
-fi
-
-if [ x$USERID = "x" -a x$UID != "x" ]
-then
- USERID=$UID
-fi
-
-if [ x$USERID != "x" -a x$USERID != "x0" ]
-then
- echo Run it as root ; exit ;
-fi
-
if [ ! -d "${OUI_PATH}" ]; then
mkdir -p ${OUI_PATH}