#!/bin/bash

# OnlyOffice install hooks — pull the compose-resolved username/password
# into the final-message argv so the user sees the credentials at the
# end of the install.

onlyoffice_install_message_data()
{
    local app_name="$1"
    local username password
    username=$(grep -oP 'username=\K[^ ]+' "$containers_dir$app_name/docker-compose.yml" 2>/dev/null)
    password=$(grep -oP 'password=\K[^ ]+' "$containers_dir$app_name/docker-compose.yml" 2>/dev/null)
    echo "$username $password"
}
