Merge branch 'alexisph-master'

This commit is contained in:
Rob Zimmerman 2014-12-02 15:16:37 -05:00
commit 6d4b68e837
3 changed files with 35 additions and 14 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.gitattributes

View file

@ -4,6 +4,10 @@ OSX Bash Script for automating the process of getting Nintendo 3DS StreetPass hi
What's New
==========
**v 1.1**
Added the Homepass relay MAC addresses
**v 1.0**
Script has been updated for the new "six at a time" feature of StreetPass Relay. The following features have been added/change:

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# The MIT License (MIT)
#
@ -22,18 +22,17 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# RelayMyHome -- v. 1.0
# RelayMyHome -- v. 1.1
# Original script by Rob Zimmerman (https://www.github.com/taintedzodiac)
# See other generous contributors, plus view the source, readme, and license at https://github.com/taintedzodiac/relaymyhome
# Tested in OS X 10.8 (Mountain Lion) and Mavericks
### The time we will pause on each MAC address
relay_time="90"
sleep_time="10"
wservice="$(/usr/sbin/networksetup -listallnetworkservices | grep -Ei '(wi-fi|airport)')"
wifi="$(networksetup -listallhardwareports | awk "/${wservice}/,/Ethernet/"' getline { print $2 }')"
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}')
echo "Original MAC address is: $WirelessMAC"
@ -104,16 +103,15 @@ then
# Create an array for the last octet of the mac address, limited range.
Addr=($(for X in {0..159} ; do echo ${X} | awk '{printf "%s%02X ", "4E:53:50:4F:4F:", $1}'; done ;))
if [[ $1 == "full" ]] ; then
num=7
echo "Full Mode enabled. Randomly seeding ${num} addresses from full list."
elif [[ $1 == "fuller" ]] ; then
num=99
if [[ $1 == "full" ]]
then
num=5
echo "Full Mode enabled. Randomly seeding five addresses from full list."
else
num=2
echo "Quick Mode enabled. Randomly seeding ${num} addresses from full list."
fi
for ((a=1; a<=$num; a++));
do
selectedAddr=${Addr[$RANDOM % ${#Addr[@]} ]}
@ -129,16 +127,33 @@ then
else
# This set of MACs will be used in standard mode
# Taken from: https://docs.google.com/spreadsheet/ccc?key=0AvvH5W4E2lIwdEFCUkxrM085ZGp0UkZlenp6SkJablE#gid=0
# Usage: ./relaymyhome
addr[0]='00:0D:67:15:2D:82'
addr[1]='00:0D:67:15:D7:21'
addr[2]='00:0D:67:15:D5:44'
addr[3]='00:0D:67:15:D2:59'
addr[4]='00:0D:67:15:D6:FD'
addr[5]='4E:53:50:4F:4F:40'
addr[6]='4E:53:50:4F:4F:41'
addr[7]='4E:53:50:4F:4F:42'
addr[8]='4E:53:50:4F:4F:43'
addr[9]='4E:53:50:4F:4F:44'
addr[10]='4E:53:50:4F:4F:45'
addr[11]='4E:53:50:4F:4F:46'
addr[12]='4E:53:50:4F:4F:47'
addr[13]='4E:53:50:4F:4F:48'
addr[14]='4E:53:50:4F:4F:49'
addr[15]='4E:53:50:4F:4F:4A'
addr[16]='4E:53:50:4F:4F:4B'
addr[17]='4E:53:50:4F:4F:4C'
addr[18]='4E:53:50:4F:4F:4D'
addr[19]='4E:53:50:4F:4F:4E'
addr[20]='4E:53:50:4F:4F:4F'
echo "Standard Mode enabled. Connecting to five Nintendo World addresses."
echo "Standard Mode enabled. Connecting to the five Nintendo World relays and the sixteen Homepass relays."
n=1
for a in "${addr[@]}"
do
echo "Cycling WiFi..."
@ -146,7 +161,7 @@ else
networksetup -setairportpower $wifi off
sleep ${sleep_time}
networksetup -setairportpower $wifi on
echo "Spoofing $wifi to ${a} for ${relay_time} seconds (${n} of 5)"
echo "Spoofing $wifi to $a for 90 seconds ($n of 21)"
n=$((n+1))
sleep ${relay_time}
done