output execution duration for each script
This commit is contained in:
parent
eb94a53242
commit
a6ea882c2f
|
@ -22,6 +22,8 @@ set -o errexit # (-e) exit immediately if any command has a non-zero exit statu
|
|||
set -o nounset # (-u) don't accept undefined variables
|
||||
#set -o xtrace # for debugging
|
||||
|
||||
timestamp_start=$(date +%s)
|
||||
|
||||
# Go where this script is.
|
||||
cd "$(dirname "$0")" || exit
|
||||
|
||||
|
@ -76,4 +78,8 @@ for cert_file in ../certs/*; do
|
|||
|
||||
done
|
||||
|
||||
echo OK
|
||||
timestamp_end=$(date +%s)
|
||||
exec_time="$((timestamp_end - timestamp_start))"
|
||||
exec_time_formatted="$(date -d "@$exec_time" --utc "+%H:%M:%S")"
|
||||
|
||||
echo "OK (duration: $exec_time_formatted)"
|
||||
|
|
|
@ -20,6 +20,8 @@ set -o errexit # (-e) exit immediately if any command has a non-zero exit statu
|
|||
set -o nounset # (-u) don't accept undefined variables
|
||||
#set -o xtrace # for debugging
|
||||
|
||||
timestamp_start=$(date +%s)
|
||||
|
||||
# Go where this script is.
|
||||
cd "$(dirname "$0")" || exit
|
||||
|
||||
|
@ -74,4 +76,8 @@ for cert_file in ../certs/*; do
|
|||
|
||||
done
|
||||
|
||||
echo OK
|
||||
timestamp_end=$(date +%s)
|
||||
exec_time="$((timestamp_end - timestamp_start))"
|
||||
exec_time_formatted="$(date -d "@$exec_time" --utc "+%H:%M:%S")"
|
||||
|
||||
echo "OK (duration: $exec_time_formatted)"
|
||||
|
|
|
@ -6,6 +6,8 @@ set -o errexit # (-e) exit immediately if any command has a non-zero exit statu
|
|||
set -o nounset # (-u) don't accept undefined variables
|
||||
#set -o xtrace # for debugging
|
||||
|
||||
timestamp_start=$(date +%s)
|
||||
|
||||
# Go where this script is.
|
||||
cd "$(dirname "$0")" || exit
|
||||
|
||||
|
@ -56,4 +58,8 @@ done
|
|||
echo "$md_table" > cert-details.md
|
||||
echo "$csv_table" > cert-details.csv
|
||||
|
||||
echo OK
|
||||
timestamp_end=$(date +%s)
|
||||
exec_time="$((timestamp_end - timestamp_start))"
|
||||
exec_time_formatted="$(date -d "@$exec_time" --utc "+%H:%M:%S")"
|
||||
|
||||
echo "OK (duration: $exec_time_formatted)"
|
||||
|
|
|
@ -6,6 +6,8 @@ set -o errexit # (-e) exit immediately if any command has a non-zero exit statu
|
|||
set -o nounset # (-u) don't accept undefined variables
|
||||
#set -o xtrace # for debugging
|
||||
|
||||
timestamp_start=$(date +%s)
|
||||
|
||||
# Go where this script is.
|
||||
cd "$(dirname "$0")" || exit
|
||||
|
||||
|
@ -144,4 +146,8 @@ while read -r host; do
|
|||
|
||||
done < hosts
|
||||
|
||||
echo OK
|
||||
timestamp_end=$(date +%s)
|
||||
exec_time="$((timestamp_end - timestamp_start))"
|
||||
exec_time_formatted="$(date -d "@$exec_time" --utc "+%H:%M:%S")"
|
||||
|
||||
echo "OK (duration: $exec_time_formatted)"
|
||||
|
|
|
@ -9,6 +9,8 @@ set -o errexit # (-e) exit immediately if any command has a non-zero exit statu
|
|||
set -o nounset # (-u) don't accept undefined variables
|
||||
#set -o xtrace # for debugging
|
||||
|
||||
timestamp_start=$(date +%s)
|
||||
|
||||
# Go where this script is.
|
||||
cd "$(dirname "$0")" || exit
|
||||
|
||||
|
@ -91,4 +93,8 @@ hosts=$(echo "$hosts" | sort)
|
|||
# Save to file.
|
||||
echo "$hosts" > hosts
|
||||
|
||||
echo OK
|
||||
timestamp_end=$(date +%s)
|
||||
exec_time="$((timestamp_end - timestamp_start))"
|
||||
exec_time_formatted="$(date -d "@$exec_time" --utc "+%H:%M:%S")"
|
||||
|
||||
echo "OK (duration: $exec_time_formatted)"
|
||||
|
|
|
@ -22,6 +22,8 @@ set -o errexit # (-e) exit immediately if any command has a non-zero exit statu
|
|||
set -o nounset # (-u) don't accept undefined variables
|
||||
#set -o xtrace # for debugging
|
||||
|
||||
timestamp_start=$(date +%s)
|
||||
|
||||
# Go where this script is.
|
||||
cd "$(dirname "$0")" || exit
|
||||
|
||||
|
@ -71,4 +73,8 @@ for cert_file in ../certs/*; do
|
|||
|
||||
done
|
||||
|
||||
echo OK
|
||||
timestamp_end=$(date +%s)
|
||||
exec_time="$((timestamp_end - timestamp_start))"
|
||||
exec_time_formatted="$(date -d "@$exec_time" --utc "+%H:%M:%S")"
|
||||
|
||||
echo "OK (duration: $exec_time_formatted)"
|
||||
|
|
8
main.sh
8
main.sh
|
@ -4,6 +4,8 @@
|
|||
|
||||
set -o errexit # (-e) exit immediately if any command has a non-zero exit status
|
||||
|
||||
timestamp_start=$(date +%s)
|
||||
|
||||
# Check if dependencies are installed.
|
||||
if ! command -v openssl >/dev/null; then
|
||||
>&2 echo '"openssl" not installed! [required]'
|
||||
|
@ -50,3 +52,9 @@ echo '=== Lagrange ==='
|
|||
lagrange/generate-trust-store.sh
|
||||
|
||||
echo "End -> $(date --utc)"
|
||||
|
||||
timestamp_end=$(date +%s)
|
||||
exec_time="$((timestamp_end - timestamp_start))"
|
||||
exec_time_formatted="$(date -d "@$exec_time" --utc "+%H:%M:%S")"
|
||||
|
||||
echo "Total duration: $exec_time_formatted"
|
||||
|
|
|
@ -8,6 +8,8 @@ set -o errexit # (-e) exit immediately if any command has a non-zero exit statu
|
|||
set -o nounset # (-u) don't accept undefined variables
|
||||
#set -o xtrace # for debugging
|
||||
|
||||
timestamp_start=$(date +%s)
|
||||
|
||||
# Go where this script is.
|
||||
cd "$(dirname "$0")" || exit
|
||||
|
||||
|
@ -29,4 +31,8 @@ find certs -mtime +30 -type f -execdir sh -c '
|
|||
fi
|
||||
' sh {} \;
|
||||
|
||||
echo OK
|
||||
timestamp_end=$(date +%s)
|
||||
exec_time="$((timestamp_end - timestamp_start))"
|
||||
exec_time_formatted="$(date -d "@$exec_time" --utc "+%H:%M:%S")"
|
||||
|
||||
echo "OK (duration: $exec_time_formatted)"
|
||||
|
|
Loading…
Reference in New Issue