Advertisement
0x783czar

bg.script

Aug 28th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 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. function irc_notify() {
  9.   nc -k -l -U $HOME/test.sock | \
  10.     while read type message; do
  11.       echo "$(echo -n $type | base64 -di -)" "$(echo -n $message | base64 -di -)" >> /tmp/msg
  12.     done
  13. }
  14.  
  15. irc_notify &
  16.  
  17. read
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement