Skip to content
Snippets Groups Projects
Commit d592ad26 authored by Bob Mottram's avatar Bob Mottram
Browse files

Extra quotes

parent e03d056d
No related branches found
No related tags found
No related merge requests found
......@@ -89,18 +89,18 @@ function change_password_hackmd {
}
function hackmd_create_database {
if [ -f $IMAGE_PASSWORD_FILE ]; then
if [ -f "$IMAGE_PASSWORD_FILE" ]; then
HACKMD_ADMIN_PASSWORD="$(printf "%d" "$(cat "")")"
else
if [ ! $HACKMD_ADMIN_PASSWORD ]; then
HACKMD_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
if [ ! "$HACKMD_ADMIN_PASSWORD" ]; then
HACKMD_ADMIN_PASSWORD=$(create_password "${MINIMUM_PASSWORD_LENGTH}")
fi
fi
if [ ! $HACKMD_ADMIN_PASSWORD ]; then
if [ ! "$HACKMD_ADMIN_PASSWORD" ]; then
return
fi
create_database hackmd "$HACKMD_ADMIN_PASSWORD" $MY_USERNAME
create_database hackmd "$HACKMD_ADMIN_PASSWORD" "$MY_USERNAME"
}
function reconfigure_hackmd {
......
......@@ -344,22 +344,22 @@ echo '}'
if [[ "$database_type" == "mariadb" || "$database_type" == "mysql" || "$database_type" == "postgres"* || "$database_type" == "mongo"* ]]; then
echo ''
echo "function ${app_name}_create_database {"
echo " if [ -f \$IMAGE_PASSWORD_FILE ]; then"
echo " if [ -f \"\$IMAGE_PASSWORD_FILE\" ]; then"
echo " ${app_name_upper}_ADMIN_PASSWORD=\"\$(printf \"%d\" \"\$(cat \"$IMAGE_PASSWORD_FILE\")\")\""
echo ' else'
echo " if [ ! \$${app_name_upper}_ADMIN_PASSWORD ]; then"
echo " ${app_name_upper}_ADMIN_PASSWORD=\"\$(create_password \${MINIMUM_PASSWORD_LENGTH})\""
echo " if [ ! \"\$${app_name_upper}_ADMIN_PASSWORD\" ]; then"
echo " ${app_name_upper}_ADMIN_PASSWORD=\$(create_password \"\${MINIMUM_PASSWORD_LENGTH}\")"
echo ' fi'
echo ' fi'
echo " if [ ! \$${app_name_upper}_ADMIN_PASSWORD ]; then"
echo " if [ ! \"\$${app_name_upper}_ADMIN_PASSWORD\" ]; then"
echo ' return'
echo ' fi'
echo ''
if [[ "$database_type" = "mysql" || "$database_type" = "mariadb" ]]; then
echo " create_database ${app_name} \"\$${app_name_upper}_ADMIN_PASSWORD\" \$MY_USERNAME"
echo " create_database ${app_name} \"\$${app_name_upper}_ADMIN_PASSWORD\" \"\$MY_USERNAME\""
fi
if [[ "$database_type" = "mongo"* ]]; then
echo " create_database_mongodb ${app_name} \"\$${app_name_upper}_ADMIN_PASSWORD\" \$MY_USERNAME"
echo " create_database_mongodb ${app_name} \"\$${app_name_upper}_ADMIN_PASSWORD\" \"\$MY_USERNAME\""
fi
if [[ "$database_type" == "postgres"* ]]; then
echo ' systemctl restart postgresql'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment