Advertisement
tolikpunkoff

Use ping in script (linux, bash)

Oct 5th, 2022
1,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.17 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #testping
  4. # $1 - IP or URL address
  5.  
  6. ping $1 -c 3 >/dev/null 2>/dev/null
  7. if [ $? -eq 0 ]; then
  8.     echo "Pinging!"
  9. else
  10.     echo "Not pinging!"
  11. fi
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement