Guest User

Untitled

a guest
Jul 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. if ["$(netstat -lpn | grep $2 | grep LISTEN)" = ""]; then
  2. echo "Port $2 is available!"
  3. else
  4. echo "Port $2 is not available!"
  5. fi
  6.  
  7. # When i run this script in the terminal i get the debug output from netstat which i don't want!
  8. # How can i only get the echo messages from if condition?
Add Comment
Please, Sign In to add comment