mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-03 23:39:45 +01:00
- omit the "**" in non colored mode
- query COLOR properly (env)
This commit is contained in:
parent
a7bbc6c39a
commit
fc4c2e5446
37
testssl.sh
37
testssl.sh
@ -51,7 +51,7 @@ CAPATH="${CAPATH:-/etc/ssl/certs/}" # same as previous. Doing nothing yet. FC ha
|
|||||||
OSSL_VER="" # openssl version, will be autodetermined
|
OSSL_VER="" # openssl version, will be autodetermined
|
||||||
NC="" # netcat will be autodetermined
|
NC="" # netcat will be autodetermined
|
||||||
ECHO="/usr/bin/printf" # works under Linux, BSD, MacOS. watch out under Solaris, not tested yet under cygwin
|
ECHO="/usr/bin/printf" # works under Linux, BSD, MacOS. watch out under Solaris, not tested yet under cygwin
|
||||||
COLOR=0 # with screen, tee and friends put 1 here (i.e. no color)
|
COLOR=${COLOR:-0} # with screen, tee and friends put 1 here (i.e. no color)
|
||||||
SHOW_LCIPHERS=no # determines whether the client side ciphers are displayed at all (makes no sense normally)
|
SHOW_LCIPHERS=no # determines whether the client side ciphers are displayed at all (makes no sense normally)
|
||||||
VERBERR=${VERBERR:-1} # 0 means to be more verbose (some like the errors to be dispayed so that one can tell better
|
VERBERR=${VERBERR:-1} # 0 means to be more verbose (some like the errors to be dispayed so that one can tell better
|
||||||
# whether the handshake succeeded or not. For errors with individual ciphers you also need to have SHOW_EACH_C=1
|
# whether the handshake succeeded or not. For errors with individual ciphers you also need to have SHOW_EACH_C=1
|
||||||
@ -105,86 +105,91 @@ off() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
liteblue() {
|
liteblue() {
|
||||||
[ $COLOR = 0 ] && out "\033[0;34m$1 " || out "$1 "
|
[ "$COLOR" = 0 ] && out "\033[0;34m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
liteblueln() { liteblue "$1"; outln; }
|
liteblueln() { liteblue "$1"; outln; }
|
||||||
|
|
||||||
blue() {
|
blue() {
|
||||||
[ $COLOR = 0 ] && out "\033[1;34m$1 " || out "$1 "
|
[ "$COLOR" = 0 ] && out "\033[1;34m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
blueln() { blue "$1"; outln; }
|
blueln() { blue "$1"; outln; }
|
||||||
|
|
||||||
|
# idea: I have a non-color term. But it can do reverse, bold and underline. Bold
|
||||||
|
# in the result equals to an alarm, underline to s.th. not working (magenta), reverse stays
|
||||||
|
# reverse
|
||||||
|
# FIXME: What bout folks who don't want color at all
|
||||||
|
|
||||||
litered() {
|
litered() {
|
||||||
[ $COLOR = 0 ] && out "\033[0;31m$1 " || out "*$1* "
|
[ "$COLOR" = 0 ] && out "\033[0;31m$1 " || bold "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
literedln() { litered "$1"; outln; }
|
literedln() { litered "$1"; outln; }
|
||||||
|
|
||||||
red() {
|
red() {
|
||||||
[ $COLOR = 0 ] && out "\033[1;31m$1 " || "**$1** "
|
[ "$COLOR" = 0 ] && out "\033[1;31m$1 " || bold "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
redln() { red "$1"; outln; }
|
redln() { red "$1"; outln; }
|
||||||
|
|
||||||
litemagenta() {
|
litemagenta() {
|
||||||
[ $COLOR = 0 ] && out "\033[0;35m$1 " || out "$1 "
|
[ "$COLOR" = 0 ] && out "\033[0;35m$1 " || underline "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
litemagentaln() { litemagenta "$1"; outln; }
|
litemagentaln() { litemagenta "$1"; outln; }
|
||||||
|
|
||||||
|
|
||||||
magenta() {
|
magenta() {
|
||||||
[ $COLOR = 0 ] && out "\033[1;35m$1 " || out "**$1** "
|
[ "$COLOR" = 0 ] && out "\033[1;35m$1 " || underline "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
magentaln() { magenta "$1"; outln; }
|
magentaln() { magenta "$1"; outln; }
|
||||||
|
|
||||||
litecyan() {
|
litecyan() {
|
||||||
[ $COLOR = 0 ] && out "\033[0;36m$1 " || out "$1 "
|
[ "$COLOR" = 0 ] && out "\033[0;36m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
litecyanln() { litecyan "$1"; outln; }
|
litecyanln() { litecyan "$1"; outln; }
|
||||||
|
|
||||||
cyan() {
|
cyan() {
|
||||||
[ $COLOR = 0 ] && out "\033[1;36m$1 " || out "**$1** "
|
[ "$COLOR" = 0 ] && out "\033[1;36m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
cyanln() { cyan "$1"; outln; }
|
cyanln() { cyan "$1"; outln; }
|
||||||
|
|
||||||
grey() {
|
grey() {
|
||||||
[ $COLOR = 0 ] && out "\033[1;30m$1 " || out "$1 "
|
[ "$COLOR" = 0 ] && out "\033[1;30m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
greyln() { grey "$1"; outln; }
|
greyln() { grey "$1"; outln; }
|
||||||
|
|
||||||
litegrey() {
|
litegrey() {
|
||||||
[ $COLOR = 0 ] && out "\033[0;37m$1 " || out "$1 "
|
[ "$COLOR" = 0 ] && out "\033[0;37m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
litegreyln() { litegrey "$1"; outln; }
|
litegreyln() { litegrey "$1"; outln; }
|
||||||
|
|
||||||
litegreen() {
|
litegreen() {
|
||||||
[ $COLOR = 0 ] && out "\033[0;32m$1 " || out "$1 "
|
[ "$COLOR" = 0 ] && out "\033[0;32m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
litegreenln() { litegreen "$1"; outln; }
|
litegreenln() { litegreen "$1"; outln; }
|
||||||
|
|
||||||
green() {
|
green() {
|
||||||
[ $COLOR = 0 ] && out "\033[1;32m$1 " || out "**$1** "
|
[ "$COLOR" = 0 ] && out "\033[1;32m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
greenln() { green "$1"; outln; }
|
greenln() { green "$1"; outln; }
|
||||||
|
|
||||||
brown() {
|
brown() {
|
||||||
[ $COLOR = 0 ] && out "\033[0;33m$1 " || out "**$1** "
|
[ "$COLOR" = 0 ] && out "\033[0;33m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
brownln() { brown "$1"; outln; }
|
brownln() { brown "$1"; outln; }
|
||||||
|
|
||||||
yellow() {
|
yellow() {
|
||||||
[ $COLOR = 0 ] && out "\033[1;33m$1 " || out "**$1** "
|
[ "$COLOR" = 0 ] && out "\033[1;33m$1 " || out "$1 "
|
||||||
off
|
off
|
||||||
}
|
}
|
||||||
yellowlnln() { yellowln "$1"; outln; }
|
yellowlnln() { yellowln "$1"; outln; }
|
||||||
@ -1948,7 +1953,7 @@ case "$1" in
|
|||||||
exit $ret ;;
|
exit $ret ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# $Id: testssl.sh,v 1.133 2014/11/17 16:05:41 dirkw Exp $
|
# $Id: testssl.sh,v 1.134 2014/11/17 16:43:58 dirkw Exp $
|
||||||
# vim:ts=5:sw=5
|
# vim:ts=5:sw=5
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user