Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/opt/local/bin/bash
- # load config file
- if [ -f ~/.macyclerc ]; then
- source ~/.macyclerc
- else
- echo "Configuration file is missing!"
- exit 0
- fi
- # for i in "${!devices[@]}"; do
- # echo "${devices[$i]}"
- # done
- # exit
- macycle(){
- if [ -z "$1" ]
- then
- promptValue() {
- printf '%7s\n' `ifconfig en1 | grep ether | cut -d" " -f2` "(active)"
- for i in "${!devices[@]}"
- do
- printf '%7s\n' "${i} : ${devices[$i]}"
- done | column -t
- read -p "Choose new MAC address: " val
- echo "${!devices[*]}"
- case $val in
- "${!devices[@]}")
- echo found1
- exit 0
- sudo ifconfig en1 ether ${!val}
- echo "Now spoofing $val"
- ;;
- *)
- printf "\e[31mbad choice\e[0m\n"
- ;;
- esac
- }
- promptValue
- else
- if [[ "$1" =~ ^(MBP|roku)$ ]]
- then
- echo found2
- exit 0
- sudo ifconfig en1 ether ${!1}
- echo "Now spoofing $1"
- else
- printf "\e[31mbad choice\e[0m\n"
- promptValue
- fi
- fi
- }
- macycle
- ###################################
- # Local Variables:
- # firestarter: "gist -u edb5e9db9248cc5d7131 %p"
- # End:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement