mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-20 16:03:06 +01:00
Use cronjob to ensure user synchronization
This commit is contained in:
@@ -220,6 +220,13 @@ function syncElastic() {
|
||||
}
|
||||
|
||||
function syncAll() {
|
||||
if [[ -n "$STALE_MIN" ]]; then
|
||||
staleCount=$(echo "select from identity_credentials where updated_at >= Datetime('now', '-${STALE_MIN} minutes');" \
|
||||
| sqlite3 "$databasePath")
|
||||
if [[ "$staleCount" == "0" ]]; then
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
syncElastic
|
||||
}
|
||||
|
||||
@@ -368,8 +375,7 @@ case "${operation}" in
|
||||
;;
|
||||
|
||||
"sync")
|
||||
syncAll
|
||||
echo "Synchronization complete"
|
||||
syncAll && echo "Synchronization completed at $(date)"
|
||||
;;
|
||||
|
||||
"validate")
|
||||
|
||||
Reference in New Issue
Block a user