Skip to content

Commit

Permalink
use /sbin/ifconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
acrogenesis committed Dec 26, 2021
1 parent 6b048e6 commit 30c657b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/macchanger
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'optparse'
options = {}
VERSION = '1.4.0'
VERSION = '1.4.1'

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

class MacChanger
def self.show(device)
show = `ifconfig #{device} |grep ether`
show = `/sbin/ifconfig #{device} |grep ether`
show[7, 17]
end

Expand All @@ -44,7 +44,7 @@ class MacChanger
end

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

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

0 comments on commit 30c657b

Please sign in to comment.