Merge pull request #1 from imariaprime/patch-1
Removes need for user to indicate wifi interface, resets MAC to default
This commit is contained in:
commit
da8965230a
1 changed files with 22 additions and 11 deletions
33
relaymyhome
33
relaymyhome
|
@ -20,14 +20,19 @@
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
# THE SOFTWARE.
|
# THE SOFTWARE.
|
||||||
|
|
||||||
# RelayMyHome -- v. 0.2
|
# RelayMyHome -- v. 0.3
|
||||||
# by Rob Zimmerman (https://www.github.com/taintedzodiac)
|
# by Rob Zimmerman (https://www.github.com/taintedzodiac)
|
||||||
# View the original source, readme, and license at https://github.com/taintedzodiac/relaymyhome
|
# View the original source, readme, and license at https://github.com/taintedzodiac/relaymyhome
|
||||||
# Tested in OS X 10.8 (Mountain Lion)
|
# Tested in OS X 10.8 (Mountain Lion)
|
||||||
|
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
if [ $2 == "full" ]
|
wservice=`/usr/sbin/networksetup -listallnetworkservices | grep -Ei '(wi-fi|airport)'`
|
||||||
|
wifi=$(networksetup -listallhardwareports | awk "/$wservice/,/Ethernet/"' getline { print $2 }')
|
||||||
|
|
||||||
|
WirelessMAC=$(networksetup -getmacaddress $wifi | awk '{print $3}')
|
||||||
|
|
||||||
|
if [ $1 == "full" ]
|
||||||
then
|
then
|
||||||
# Generate a full list of 160 MAC's when "full" mode is specified
|
# Generate a full list of 160 MAC's when "full" mode is specified
|
||||||
# To use full mode: ./relaymyhome en1 full
|
# To use full mode: ./relaymyhome en1 full
|
||||||
|
@ -56,10 +61,10 @@ then
|
||||||
do
|
do
|
||||||
selectedAddr=${Addr[$RANDOM % ${#Addr[@]} ]}
|
selectedAddr=${Addr[$RANDOM % ${#Addr[@]} ]}
|
||||||
echo "Cycling WiFi..."
|
echo "Cycling WiFi..."
|
||||||
sudo ifconfig $1 lladdr $selectedAddr
|
sudo ifconfig $wifi lladdr $selectedAddr
|
||||||
networksetup -setairportpower $1 off
|
networksetup -setairportpower $wifi off
|
||||||
networksetup -setairportpower $1 on
|
networksetup -setairportpower $wifi on
|
||||||
echo "Spoofing $1 to $selectedAddr for 60 seconds"
|
echo "Spoofing $wifi to $selectedAddr for 60 seconds"
|
||||||
sleep 60
|
sleep 60
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -93,12 +98,18 @@ else
|
||||||
for a in "${addr[@]}"
|
for a in "${addr[@]}"
|
||||||
do
|
do
|
||||||
echo "Cycling WiFi..."
|
echo "Cycling WiFi..."
|
||||||
sudo ifconfig $1 lladdr $a
|
sudo ifconfig $wifi lladdr $a
|
||||||
networksetup -setairportpower $1 off
|
networksetup -setairportpower $wifi off
|
||||||
networksetup -setairportpower $1 on
|
networksetup -setairportpower $wifi on
|
||||||
echo "Spoofing $1 to $a for 60 seconds"
|
echo "Spoofing $wifi to $a for 60 seconds"
|
||||||
sleep 60
|
sleep 60
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Cycling of Relays has completed. Time to check your StreetPasses!"
|
ifconfig $wifi lladdr $WirelessMAC
|
||||||
|
networksetup -setairportpower $wifi off
|
||||||
|
networksetup -setairportpower $wifi on
|
||||||
|
|
||||||
|
|
||||||
|
echo "Cycling of Relays has completed, MAC address reverted."
|
||||||
|
echo "Time to check your StreetPasses!"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue