%PDF- %PDF-
| Direktori : /opt/bitnami/var/init/post-start/ |
| Current File : /opt/bitnami/var/init/post-start/050_bitnami_credentials_file |
#!/bin/sh
#
# Create a separate file with credentials based on welcome message.
# Copyright 2020 Bitnami.com All Rights Reserved
#
. /opt/bitnami/scripts/init/functions
if [ "xbitnami" != "xroot" ] && [ -d "/home/bitnami" ]; then
USERHOME="/home/bitnami"
else
USERHOME="/root"
fi
cp /dev/null $USERHOME/bitnami_credentials || exit 1
chown bitnami:bitnami $USERHOME/bitnami_credentials || exit 1
chmod 0400 $USERHOME/bitnami_credentials || exit 1
bitnami_credentials_header() {
echo "Welcome to the Bitnami Moodle Stack"
echo
application_password=`get_applications_password`
if [ "x$application_password" = "x" ] ; then
application_password='bitnami'
fi
# If the application uses password and we have configured one
if [ "xbitnami" != "x" -a "x$application_password" != "x" ]; then
if [ "xuser" != "x" ] ; then
echo "******************************************************************************"
echo "The default username and password is 'user' and '$application_password'."
echo "******************************************************************************"
echo
else
echo "******************************************************************************"
echo "The default password is '$application_password'."
echo "******************************************************************************"
echo
fi
echo "You can also use this password to access the databases and any other component the stack includes."
echo
fi
echo "Please refer to https://docs.bitnami.com/ for more details."
echo
}
run_once_globally_check "bitnami_credentials_template"
if [ $? -eq 0 ]; then
mkdir -p "$DATA_DIR/bitnami_credentials" && chmod 0755 "$DATA_DIR/bitnami_credentials" && rm -f "$DATA_DIR/bitnami_credentials/*"
bitnami_credentials_header >$DATA_DIR/bitnami_credentials/credentials
fi
cat $DATA_DIR/bitnami_credentials/credentials > $USERHOME/bitnami_credentials