Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. #!/opt/local/bin/bash
  2.  
  3. # load config file
  4. if [ -f ~/.macyclerc ]; then
  5. source ~/.macyclerc
  6. else
  7. echo "Configuration file is missing!"
  8. exit 0
  9. fi
  10.  
  11. # for i in "${!devices[@]}"; do
  12. # echo "${devices[$i]}"
  13. # done
  14. # exit
  15.  
  16.  
  17.  
  18. macycle(){
  19.  
  20. if [ -z "$1" ]
  21. then
  22. promptValue() {
  23. printf '%7s\n' `ifconfig en1 | grep ether | cut -d" " -f2` "(active)"
  24. for i in "${!devices[@]}"
  25. do
  26. printf '%7s\n' "${i} : ${devices[$i]}"
  27. done | column -t
  28. read -p "Choose new MAC address: " val
  29. echo "${!devices[*]}"
  30. case $val in
  31. "${!devices[@]}")
  32. echo found1
  33. exit 0
  34. sudo ifconfig en1 ether ${!val}
  35. echo "Now spoofing $val"
  36. ;;
  37. *)
  38. printf "\e[31mbad choice\e[0m\n"
  39. ;;
  40. esac
  41. }
  42. promptValue
  43. else
  44. if [[ "$1" =~ ^(MBP|roku)$ ]]
  45. then
  46. echo found2
  47. exit 0
  48. sudo ifconfig en1 ether ${!1}
  49. echo "Now spoofing $1"
  50. else
  51. printf "\e[31mbad choice\e[0m\n"
  52. promptValue
  53. fi
  54. fi
  55.  
  56. }
  57. macycle
  58. ###################################
  59. # Local Variables:
  60. # firestarter: "gist -u edb5e9db9248cc5d7131 %p"
  61. # End:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement