Some changes on script output.

This commit is contained in:
Christoph 2017-09-27 17:16:17 +02:00
parent 7a89140a10
commit ca546aacc5

View File

@ -53,7 +53,7 @@ warn (){
info (){ info (){
if $terminal ; then if $terminal ; then
echo "" echo ""
echo -e "\t[ \033[32m\033[1mInfo\033[m ]: $*" echo -e " [ \033[32m\033[1mInfo\033[m ]: $*"
echo "" echo ""
fi fi
} }
@ -67,7 +67,7 @@ info (){
# - Running in a terminal? # - Running in a terminal?
# - # -
if [[ -t 1 ]] ; then if [[ -t 1 ]] ; then
terminal=true terminal=true
else else
terminal=false terminal=false
fi fi
@ -115,18 +115,27 @@ if [[ ${#revoked_serial_arr[@]} -gt 0 ]]; then
fi fi
done done
else else
info "No revoked OpenVPN keys exists" info "No revoked OpenVPN keys in \033[1m${KEY_DIR}\033[m exists"
fi fi
echo echo
for _val in ${revoked_cn_arr[@]} ; do if [[ ${#revoked_cn_arr[@]} -gt 0 ]]; then
IFS=':' read -a _val_arr <<< "${_val}" echo ""
if $terminal ; then if $terminal ; then
echo -e " Serial: \033[1m${_val_arr[0]}\033[m CN: \033[1m${_val_arr[1]}\033[m" echo -e "Revoked Keys in \033[32m\033[1m${KEY_DIR}\033[m:"
else else
echo " Serial: ${_val_arr[0]} CN: ${_val_arr[1]}" echo "Revoked Keys in ${KEY_DIR}:"
fi fi
done echo ""
for _val in ${revoked_cn_arr[@]} ; do
IFS=':' read -a _val_arr <<< "${_val}"
if $terminal ; then
echo -e " Serial: \033[1m${_val_arr[0]}\033[m CN: \033[1m${_val_arr[1]}\033[m"
else
echo " Serial: ${_val_arr[0]} CN: ${_val_arr[1]}"
fi
done
fi
echo echo
exit exit