mirror of https://github.com/akelge/zsh
changes 2
This commit is contained in:
parent
3abc63bd04
commit
4f2a64d0f3
|
@ -1,11 +1,11 @@
|
||||||
usage() {
|
usage() {
|
||||||
echo "x509 <certfile>"
|
echo "x509 <certfile>"
|
||||||
echo "x509 -r <hostname:port>"
|
echo "x509 -r <hostname:port>"
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $# -eq 0 ] && usage
|
[ $# -eq 0 ] && usage
|
||||||
|
|
||||||
|
help=0
|
||||||
remote=0
|
remote=0
|
||||||
|
|
||||||
while getopts ":hr:" arg; do
|
while getopts ":hr:" arg; do
|
||||||
|
@ -14,10 +14,10 @@ while getopts ":hr:" arg; do
|
||||||
remote=1
|
remote=1
|
||||||
host=$OPTARG
|
host=$OPTARG
|
||||||
;;
|
;;
|
||||||
h) usage
|
h) help=1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
[ $help -eq 0 ] && usage && return
|
||||||
[ $remote -eq 0 ] && openssl x509 -in $* -noout -text
|
[ $remote -eq 0 ] && openssl x509 -in $* -noout -text
|
||||||
[ $remote -eq 1 ] && openssl s_client -connect $host < /dev/null | openssl x509 -noout -text
|
[ $remote -eq 1 ] && openssl s_client -connect $host < /dev/null | openssl x509 -noout -text
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue