GeoNetAgent, LDAPWeb, server-audit, server-connection
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

13 lines
545 B

#!/bin/bash
# One-time: align Dockge admin on mailserver agent with primary (.24) credentials.
set -euo pipefail
DB=/opt/dockge/data/dockge.db
HASH='$2a$10$66pkg5WxDVUPLlZi4aLLTOPcLO3PFFRpdzl.j7973LpyD4evjLJki'
COUNT=$(sqlite3 "$DB" 'SELECT COUNT(*) FROM user;')
if [ "$COUNT" -eq 0 ]; then
sqlite3 "$DB" "INSERT INTO user (username, password, active, twofa_status) VALUES ('admin', '$HASH', 1, 0);"
echo "Admin user created on Dockge agent."
else
echo "User already exists, skipped."
fi
sqlite3 "$DB" 'SELECT username, active FROM user;'