Dear KeesvandenBos,
I 've edited the same script into notepad ++ as recommended and the file now is compatible with unix bash.
I was also able to cat /tmp/cert-mapping.bash (below):
The question now how can I run it ? tmsh ? bash ./cert-mapping is not working ?
[root@f5-IB-2:Standby:In Sync] config #
^[[A[root@f5-IB-2:Standby:In Sync] config # cat /tmp/cert-mapping.bash
#!/bin/bash
# Search /config and sub directories (partitions) for bigip.conf files
LIST=`find /config -name bigip.conf | xargs awk '$2 == "virtual" {print $3}' 2> /dev/null | sort -u`
echo "Virtual: Profile: Certificate: Ciphers:"
echo "__________________________________________________________"
for VAL in ${LIST}
do
PROF=`tmsh show /ltm virtual ${VAL} profiles 2> /dev/null | grep -B 1 " Ltm::ClientSSL Profile:" | cut -d: -f4 | grep -i "[a-z]" | sed s'/ //'g| sort -u`
test -n "${PROF}" 2>&- && {
VIRTS=`expr $VIRTS + 1`
for PCRT in ${PROF}
do
CERT=`tmsh list /ltm profile client-ssl ${PCRT} | awk '$1 == "cert" {print $2}' 2> /dev/null | sort -u`
test -n "${CERT}" 2>&- && {
CIPHERS=`tmsh list /ltm profile client-ssl ${PCRT} ciphers | grep ciphers | awk '{print $2}'`
echo "${VAL} ${PCRT} ${CERT} ${CIPHERS}"
}
done
}
done
echo "Virtual server count: ${VIRTS}"[root@f5-IB-2:Standby:In Sync] config #
[root@f5-IB-2:Standby:In Sync] config #
[root@f5-IB-2:Standby:In Sync] config #