mirror of https://github.com/akelge/zsh
changes 4
This commit is contained in:
parent
863abe744e
commit
ec0eab3b21
|
@ -1,10 +1,12 @@
|
||||||
usage() {
|
usage() {
|
||||||
echo "x509 <certfile>"
|
echo "x509 <certfile>"
|
||||||
echo "x509 -r <hostname:port>"
|
echo "x509 -r <hostname:port>"
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[ $# -eq 0 ] && return 0
|
if [ $# -eq 0 ]; then
|
||||||
|
usage
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
help=0
|
help=0
|
||||||
remote=0
|
remote=0
|
||||||
|
@ -19,6 +21,22 @@ while getopts ":hr:" arg; do
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
[ $help -eq 1 ] && usage && return 0
|
|
||||||
[ $remote -eq 0 ] && openssl x509 -in $* -noout -text
|
if [ $help -eq 1 ]; then
|
||||||
[ $remote -eq 1 ] && openssl s_client -connect $host < /dev/null | openssl x509 -noout -text
|
usage
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $remote -eq 0 ]; then
|
||||||
|
if [ -f $* ]; then
|
||||||
|
openssl x509 -in $* -noout -text
|
||||||
|
else
|
||||||
|
echo "$* not found"
|
||||||
|
usage
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
openssl s_client -connect $host < /dev/null | openssl x509 -noout -text
|
||||||
|
fi
|
||||||
|
|
||||||
|
# vim: set ts=2 sw=2 tw=0 ft=sh :
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue