Guest User

Untitled

a guest
Jan 16th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/bin/bash
  2. fifo_in="/tmp/ssh-fifo.$$"
  3.  
  4. exit_trap() {
  5. unlink "$fifo_in"
  6. echo "goodbye."
  7. }
  8. trap exit_trap EXIT
  9.  
  10. mkfifo "$fifo_in"
  11.  
  12. ssh -T mute@localhost <"${fifo_in}" | {
  13. exec 10>"$fifo_in"
  14.  
  15. # send a command to remote host)
  16. echo "uname -a" >&10
  17.  
  18. # input still come from stdin (the pipe)
  19. read -r line
  20. if [[ $line =~ "2.6.32" ]]; then
  21. echo "omg this guy should upgrade";
  22. fi
  23. }
Add Comment
Please, Sign In to add comment