%PDF- %PDF-
| Direktori : /opt/bitnami/scripts/init/ |
| Current File : /opt/bitnami/scripts/init/configure_default_passwords |
#!/bin/sh
#
# Configure the default password in all services and applications
# Copyright 2020 Bitnami.com All Rights Reserved
#
. /opt/bitnami/scripts/init/functions
# when run with --force option, set the password regardless of flag
if [ "x$1" != "x--force" ] ; then
run_once_globally_check "configure_default_passwords"
if [ $? -ne 0 ]; then
exit 0
fi
fi
# get if password should be modified
PASSWD="`get_applications_password`"
if [ "x$PASSWD" = "x" ] ; then
echo "Not setting Bitnami application passwords"
exit 0
fi
# start database services
for SERVICE in mysql mariadb postgresql mongodb ; do
/opt/bitnami/ctlscript.sh start $SERVICE </dev/null >/dev/null 2>&1
done
# set password for all services and start them
# so password can be set for applications depending on them
for BNCONFIG in `find /opt/bitnami -maxdepth 2 -name bnconfig -executable` ; do
BNCONFIGDIR="`dirname "$BNCONFIG"`"
BNCONFIGDIRNAME="`basename "$BNCONFIGDIR"`"
echo "[`date`] Setting up password for $BNCONFIGDIRNAME service"
"$BNCONFIG" --userpassword "$PASSWD"
echo "[`date`] Setting up password for $BNCONFIGDIRNAME service finished"
done
# start database services
for SERVICE in mysql mariadb postgresql mongodb ; do
/opt/bitnami/ctlscript.sh start $SERVICE </dev/null >/dev/null 2>&1
done
# set password for all applications; set public IP as well
for BNCONFIG in `find /opt/bitnami/apps -maxdepth 2 -name bnconfig -executable` ; do
BNCONFIGDIR="`dirname "$BNCONFIG"`"
BNCONFIGDIRNAME="`basename "$BNCONFIGDIR"`"
echo "[`date`] Setting up password for $BNCONFIGDIRNAME application"
"$BNCONFIG" --userpassword "$PASSWD"
echo "[`date`] Setting up password for $BNCONFIGDIRNAME application finished"
done
echo "[`date`] Finished setting password"