Guest User

Untitled

a guest
Jan 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. function what_is_up {
  2. nmap 127.0.0.1 -p 8070,8080,8090 | awk '
  3. BEGIN {
  4. count=0;
  5. }
  6. /^[0-9]+\/tcp/, // {
  7. ORS="";
  8. if ($2 == "open") {
  9. if (count == 0) { print ":"; }
  10. if (count > 0) { print ","; }
  11. printf("\033[92m%s\033[00m", substr($1, 1, length($1) - 4));
  12. count +=1;
  13. }
  14. }'
  15. }
  16.  
  17. function what_ip {
  18. ifconfig en1 inet | awk '/inet/ {printf("\033[92m%s\033[00m", $2); }'
  19. }
  20.  
  21. source /usr/local/etc/bash_completion.d/git-completion.bash
  22. export PS1='\u@$(what_ip)$(what_is_up)/\W$(__git_ps1 " [\[\033[92m\]%s\[\033[00m\]]") $ '
Add Comment
Please, Sign In to add comment