Advertisement
0x783czar

fg.script

Aug 28th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3.  
  4. # to aid in cleanup when using Ctrl-C to exit strace
  5. trap "pkill -f -x 'nc -k -l -U $HOME/test.sock'; exit" SIGINT
  6.  
  7. # Start listening for notifications
  8. nc -k -l -U $HOME/test.sock | \
  9.   while read type message; do
  10.     echo "$(echo -n $type | base64 -di -)" "$(echo -n $message | base64 -di -)" >> /tmp/msg
  11.   done &
  12.  
  13. read
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement