Skip to content

Commit

Permalink
Added logging for the automatic endpoint update script
Browse files Browse the repository at this point in the history
  • Loading branch information
rishi-salunkhe-mettle committed Aug 28, 2024
1 parent ccc02bb commit 6d5a5f1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/automatic_endpoint_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ EMAIL=

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
log_file="/etc/lantern/logs/automatic_endpoint_update_logs.txt"
current_datetime=$(date +"%Y-%m-%d %H:%M:%S")

chmod +rx query-endpoint-resources.sh; ./query-endpoint-resources.sh
docker exec lantern-back-end_endpoint_manager_1 /etc/lantern/populateEndpoints.sh || echo "Lantern failed to save endpoint information in database after endpoint resource list updates." | /usr/bin/mail -s "Automatic endpoint update and database population error." ${EMAIL}
docker exec lantern-back-end_endpoint_manager_1 /etc/lantern/populateEndpoints.sh || {
echo "$current_datetime - Lantern failed to save endpoint information in database after endpoint resource list updates." >> $log_file
echo "Lantern failed to save endpoint information in database after endpoint resource list updates." | /usr/bin/mail -s "Automatic endpoint update and database population error." ${EMAIL}
exit 0
}

echo "$current_datetime - Automatic Endpoint Update complete" >> $log_file

0 comments on commit 6d5a5f1

Please sign in to comment.