use ego-mgr for username/email instead of CLI flags
This commit is contained in:
@@ -3,29 +3,12 @@
|
||||
# Get the directory where this script is located
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
# Optional explicit username
|
||||
username=""
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--username)
|
||||
username="$2"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
echo "Usage: $0 [--username <username>]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# Get username from ego-mgr
|
||||
username=$(ego-mgr get default-username)
|
||||
|
||||
# Default to secret-mgr if not provided
|
||||
# Check if username is provided
|
||||
if [[ -z "$username" ]]; then
|
||||
username=$(secret-mgr get-username --key keycloak)
|
||||
fi
|
||||
|
||||
if [[ -z "$username" ]]; then
|
||||
echo "Error: No keycloak username found in secret-mgr"
|
||||
echo "Error: default-username not set in ego-mgr, please contact ard"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user