Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- numtries=10000
- hosts=(host1.localhost.local host2.localhost.local host3.localhost.local)
- checkcert()
- {
- output=$(gnutls-cli $1 &)
- check=$(echo "$output" | grep "hostname")
- if [[ "$check" != *NOT* ]]; then
- # match
- echo -en "\e[32m"
- echo "$check"
- echo -en "\e[0m"
- else
- # no match
- echo -en "\e[31m"
- echo "$output"
- echo -en "\e[0m"
- exit 1
- fi
- }
- randhost()
- {
- let "i = $RANDOM % ${#hosts[@]}"
- echo ${hosts[$i]}
- }
- for i in $(seq 1 $numtries)
- do
- checkcert $(randhost)
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement