aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJonathan Beezley2012-06-11 09:50:28 -0600
committerAdam Vandenberg2012-06-12 20:41:07 -0700
commit76a34e8e4430c89409e0a663b77962f4e7279860 (patch)
tree39e1fef4a07e2a5ba50044577705217e6c78633c /Library
parentaa496717ebf36b09941fa7eefaf92818dd520f79 (diff)
downloadhomebrew-76a34e8e4430c89409e0a663b77962f4e7279860.tar.bz2
aircrack-ng: remove root requirement for the OUI update script
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/aircrack-ng.rb44
1 files changed, 40 insertions, 4 deletions
diff --git a/Library/Formula/aircrack-ng.rb b/Library/Formula/aircrack-ng.rb
index 6b5bd1073..5a4968701 100644
--- a/Library/Formula/aircrack-ng.rb
+++ b/Library/Formula/aircrack-ng.rb
@@ -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}
+