Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- fifo_in="/tmp/ssh-fifo.$$"
- exit_trap() {
- unlink "$fifo_in"
- echo "goodbye."
- }
- trap exit_trap EXIT
- mkfifo "$fifo_in"
- ssh -T mute@localhost <"${fifo_in}" | {
- exec 10>"$fifo_in"
- # send a command to remote host)
- echo "uname -a" >&10
- # input still come from stdin (the pipe)
- read -r line
- if [[ $line =~ "2.6.32" ]]; then
- echo "omg this guy should upgrade";
- fi
- }
Add Comment
Please, Sign In to add comment