Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- file=$(mktemp)
- trap 'rm $file' EXIT
- (while true
- do
- 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"
- sleep 1
- done) &
- pid=$!
- trap 'kill $pid; rm $file' EXIT
- tail -f "$file" | sed --unbuffered \
- -e 's/\(.*DEBUG.*\)/\o033[36m\1\o033[39m/' \
- -e 's/\(.*INFO.*\)/\o033[32m\1\o033[39m/' \
- -e 's/\(.*WARN.*\)/\o033[33m\1\o033[39m/' \
- -e 's/\(.*ERROR.*\)/\o033[31m\1\o033[39m/'
Add Comment
Please, Sign In to add comment