IsraelTorres

profilebuilder.sh

Dec 16th, 2014
267
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Israel Torres / Kyle Price
  3. # 20141216 b
  4. # profilebuilder.sh
  5. # PoC profile builder for raspberry pi (tested on b+)
  6. #
  7. function get-sshRSA00 () {
  8.         sshRSA00=$(ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub | cut -d ' ' -f 2)
  9.         echo $sshRSA00
  10. }
  11.  
  12. function get-eth000 () {
  13.     eth000=$(ifconfig | grep eth0 | tr -s ' ' | cut -d ' ' -f 5)
  14.     echo $eth000
  15. }
  16.  
  17. function get-wlan000 () {
  18.     wlan000=$(ifconfig | grep wlan | tr -s ' ' | cut -d ' ' -f 5)
  19.     echo $wlan000
  20. }
  21.  
  22. function get-internet00 () {
  23.     internet00=$(curl -s http://ipecho.net/plain)
  24.     echo $internet00
  25. }
  26.  
  27. function get-piserial00 () {
  28.     piserial00=$(grep 'Serial' /proc/cpuinfo | cut  -d ' ' -f 2)
  29.     echo $piserial00
  30. }
  31.  
  32. sshRSA00=$(get-sshRSA00)
  33. eth000=$(get-eth000)
  34. wlan000=$(get-wlan000)
  35. internet00=$(get-internet00)
  36. piserial00=$(get-piserial00)
  37.  
  38. echo -en "ssh      :\t$sshRSA00\n"
  39. echo -en "eth0     :\t$eth000\n"
  40. echo -en "wlan0    :\t$wlan000\n"
  41. echo -en "internet0:\t$internet00\n"
  42. echo -en "serial no:\t$piserial00\n"
  43.  
  44. #eof
RAW Paste Data