- FreeBSD fixes (getent, printf)
This commit is contained in:
parent
59bdf48823
commit
f2c44803ed
23
testssl.sh
23
testssl.sh
|
@ -569,7 +569,7 @@ show_rfc_style(){
|
||||||
# header and list for all_ciphers+cipher_per_proto, and PFS+RC4
|
# header and list for all_ciphers+cipher_per_proto, and PFS+RC4
|
||||||
neat_header(){
|
neat_header(){
|
||||||
outln "Hexcode Cipher Suite Name (OpenSSL) KeyExch. Encryption Bits${MAP_RFC_FNAME:+ Cipher Suite Name (RFC)}"
|
outln "Hexcode Cipher Suite Name (OpenSSL) KeyExch. Encryption Bits${MAP_RFC_FNAME:+ Cipher Suite Name (RFC)}"
|
||||||
outln "-------------------------------------------------------------------------${MAP_RFC_FNAME:+----------------------------------------------}"
|
outln "%s-------------------------------------------------------------------------${MAP_RFC_FNAME:+----------------------------------------------}"
|
||||||
}
|
}
|
||||||
|
|
||||||
neat_list(){
|
neat_list(){
|
||||||
|
@ -1576,8 +1576,7 @@ cleanup () {
|
||||||
rm ${TMPFILE} ${HEADERFILE} ${HEADERFILE_BREACH} ${LOGFILE} ${GOST_CONF} 2>/dev/null
|
rm ${TMPFILE} ${HEADERFILE} ${HEADERFILE_BREACH} ${LOGFILE} ${GOST_CONF} 2>/dev/null
|
||||||
fi
|
fi
|
||||||
outln
|
outln
|
||||||
outln
|
[ -n "$NODE" ] && datebanner "Done" # only if running against server
|
||||||
datebanner "Done"
|
|
||||||
outln
|
outln
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1698,15 +1697,14 @@ get_dns_entries() {
|
||||||
if which getent 2>&1 >/dev/null ; then
|
if which getent 2>&1 >/dev/null ; then
|
||||||
getent ahostsv4 $NODE 2>/dev/null >/dev/null
|
getent ahostsv4 $NODE 2>/dev/null >/dev/null
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# Linux, no BSD
|
# Linux:
|
||||||
key2get=ahostsv4
|
IP4=`getent ahostsv4 $NODE 2>/dev/null | grep -v ':' | grep STREAM | awk '{ print $1}' | uniq`
|
||||||
else
|
#else
|
||||||
key2get=hosts
|
# IP4=`getent hosts $NODE 2>/dev/null | grep -v ':' | awk '{ print $1}' | uniq`
|
||||||
|
#FIXME: FreeBSD returns only one entry
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
IP4=`getent $key2get $NODE 2>/dev/null | grep STREAM | awk '{ print $1}' | uniq`
|
if [ -z "$IP4" ] ; then # getent returned nothing:
|
||||||
# getent returned nothing:
|
|
||||||
if [ -z "$IP4" ] ; then
|
|
||||||
IP4=`host -t a $NODE | grep -v alias | sed 's/^.*address //'`
|
IP4=`host -t a $NODE | grep -v alias | sed 's/^.*address //'`
|
||||||
if echo "$IP4" | grep -q NXDOMAIN || echo "$IP4" | grep -q "no A record"; then
|
if echo "$IP4" | grep -q NXDOMAIN || echo "$IP4" | grep -q "no A record"; then
|
||||||
magenta "Can't proceed: No IP address for \"$NODE\" available"; outln "\n"
|
magenta "Can't proceed: No IP address for \"$NODE\" available"; outln "\n"
|
||||||
|
@ -1755,8 +1753,9 @@ display_rdns_etc() {
|
||||||
|
|
||||||
datebanner() {
|
datebanner() {
|
||||||
tojour=`date +%F`" "`date +%R`
|
tojour=`date +%F`" "`date +%R`
|
||||||
|
outln
|
||||||
reverse "$1 now ($tojour) ---> $NODEIP:$PORT ($NODE) <---"; outln
|
reverse "$1 now ($tojour) ---> $NODEIP:$PORT ($NODE) <---"; outln
|
||||||
if [ "$1" = "Testing" ] ; then
|
if [ "$1" = "Testing" ] ; then
|
||||||
outln
|
outln
|
||||||
display_rdns_etc
|
display_rdns_etc
|
||||||
outln
|
outln
|
||||||
|
@ -1940,7 +1939,7 @@ case "$1" in
|
||||||
exit $ret ;;
|
exit $ret ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# $Id: testssl.sh,v 1.140 2014/11/18 19:23:16 dirkw Exp $
|
# $Id: testssl.sh,v 1.141 2014/11/18 22:12:54 dirkw Exp $
|
||||||
# vim:ts=5:sw=5
|
# vim:ts=5:sw=5
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue