mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Recover from situation where roles file is corrupted
This commit is contained in:
@@ -158,7 +158,7 @@ function createFile() {
|
||||
}
|
||||
|
||||
function ensureRoleFileExists() {
|
||||
if [ ! -s "$socRolesFile" ]; then
|
||||
if [[ ! -f "$socRolesFile" || ! -s "$socRolesFile" ]]; then
|
||||
if [[ -f "$databasePath" ]]; then
|
||||
echo "Migrating roles to new file: $socRolesFile"
|
||||
|
||||
@@ -170,6 +170,7 @@ function ensureRoleFileExists() {
|
||||
>> "$rolesTmpFile"
|
||||
[[ $? != 0 ]] && fail "Unable to read identities from database"
|
||||
|
||||
rm -fr "$socRolesFile"
|
||||
mv "${rolesTmpFile}" "${socRolesFile}"
|
||||
else
|
||||
echo "Database file does not exist yet, installation is likely not yet complete."
|
||||
|
||||
Reference in New Issue
Block a user