Guest User

Untitled

a guest
Feb 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. file=$(mktemp)
  4. trap 'rm $file' EXIT
  5.  
  6. (while true
  7. do
  8. curl --fail -s --cert /home/jason/Downloads/my.crt.pem --key /home/jason/Downloads/my.key.pem -k -r "$(stat -c %s "$file")"- "$1" >> "$file"
  9. sleep 1
  10. done) &
  11.  
  12. pid=$!
  13. trap 'kill $pid; rm $file' EXIT
  14.  
  15. tail -f "$file" | sed --unbuffered \
  16. -e 's/\(.*DEBUG.*\)/\o033[36m\1\o033[39m/' \
  17. -e 's/\(.*INFO.*\)/\o033[32m\1\o033[39m/' \
  18. -e 's/\(.*WARN.*\)/\o033[33m\1\o033[39m/' \
  19. -e 's/\(.*ERROR.*\)/\o033[31m\1\o033[39m/'
Add Comment
Please, Sign In to add comment