Advertisement
Guest User

Ping Testing Script

a guest
Aug 22nd, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.91 KB | None | 0 0
  1. #!/bin/bash
  2. #######################
  3. # Bash Testing Script #
  4. #######################
  5.  
  6. function _MENU_BAR
  7. {
  8.         printf "|--------------------------------|\n"
  9. }
  10.  
  11. clear
  12.  
  13. printf "Testing Script v1.0 - Output Test\n"
  14. _MENU_BAR
  15. ###### "|--------------------------------|\n"
  16. printf "| Google Ping      | Starting... |\n"
  17. printf "| Bing Ping        | Starting... |\n"
  18. printf "| Custom IP        | Starting... |\n"
  19. _MENU_BAR
  20.  
  21. google_ping=$(ping -c 2 www.google.com | grep -oP '\d+(?=% packet loss)') &
  22. bing_ping=$(ping -c 2 www.bing.com | grep -oP '\d+(?=% packet loss)') &
  23. Cust_Ping=$(ping -c 2 10.1.1.1 | grep -oP '\d+(?=% packet loss)' ) &
  24.  
  25.  
  26. printf "\e[8;0H\e[36m<<Pinging in Progress>>\e[0m\n"
  27.  
  28. wait
  29.  
  30. printf "\e[3;21H\e[32m\e[K %3d\e[0m\t |" $google_ping
  31. printf "\e[4;21H\e[32m\e[K %3d\e[0m\t |" $bing_ping
  32. printf "\e[5;21H\e[32m\e[K %3d\e[0m\t |" $Cust_Ping
  33. printf "\e[8;0H\e[K\e[0mPings Complete!\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement