Skip to content

Commit 30c657b

Browse files
committed
use /sbin/ifconfig
1 parent 6b048e6 commit 30c657b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/macchanger

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'optparse'
44
options = {}
5-
VERSION = '1.4.0'
5+
VERSION = '1.4.1'
66

77
optparse = OptionParser.new do |opts|
88
opts.banner = 'Usage: macchanger [options] device'
@@ -28,7 +28,7 @@ end
2828

2929
class MacChanger
3030
def self.show(device)
31-
show = `ifconfig #{device} |grep ether`
31+
show = `/sbin/ifconfig #{device} |grep ether`
3232
show[7, 17]
3333
end
3434

@@ -44,7 +44,7 @@ class MacChanger
4444
end
4545

4646
def self.down?(device)
47-
unless `ifconfig -d |grep -E '^#{device}:'`.empty?
47+
unless `/sbin/ifconfig -d |grep -E '^#{device}:'`.empty?
4848
fail OptionParser::InvalidArgument, "Device #{device} is down"
4949
end
5050
end
@@ -60,7 +60,7 @@ class MacChanger
6060

6161
def self.set(options)
6262
if system("sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport #{options[:device]} -z")
63-
if system("sudo ifconfig #{options[:device]} ether #{options[:mac]}")
63+
if system("sudo /sbin/ifconfig #{options[:device]} ether #{options[:mac]}")
6464
show(options[:device]) == options[:mac]
6565
end
6666
else

0 commit comments

Comments
 (0)