mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
helper doc fixes : postgresql
This commit is contained in:
parent
706dbe723e
commit
dc27fd3ec3
1 changed files with 10 additions and 9 deletions
|
@ -5,15 +5,15 @@ PSQL_VERSION=11
|
||||||
|
|
||||||
# Open a connection as a user
|
# Open a connection as a user
|
||||||
#
|
#
|
||||||
# examples:
|
|
||||||
# ynh_psql_connect_as 'user' 'pass' <<< "UPDATE ...;"
|
|
||||||
# ynh_psql_connect_as 'user' 'pass' < /path/to/file.sql
|
|
||||||
#
|
|
||||||
# usage: ynh_psql_connect_as --user=user --password=password [--database=database]
|
# usage: ynh_psql_connect_as --user=user --password=password [--database=database]
|
||||||
# | arg: -u, --user= - the user name to connect as
|
# | arg: -u, --user= - the user name to connect as
|
||||||
# | arg: -p, --password= - the user password
|
# | arg: -p, --password= - the user password
|
||||||
# | arg: -d, --database= - the database to connect to
|
# | arg: -d, --database= - the database to connect to
|
||||||
#
|
#
|
||||||
|
# examples:
|
||||||
|
# ynh_psql_connect_as 'user' 'pass' <<< "UPDATE ...;"
|
||||||
|
# ynh_psql_connect_as 'user' 'pass' < /path/to/file.sql
|
||||||
|
#
|
||||||
# Requires YunoHost version 3.5.0 or higher.
|
# Requires YunoHost version 3.5.0 or higher.
|
||||||
ynh_psql_connect_as() {
|
ynh_psql_connect_as() {
|
||||||
# Declare an array to define the options of this helper.
|
# Declare an array to define the options of this helper.
|
||||||
|
@ -127,12 +127,12 @@ ynh_psql_drop_db() {
|
||||||
|
|
||||||
# Dump a database
|
# Dump a database
|
||||||
#
|
#
|
||||||
# example: ynh_psql_dump_db 'roundcube' > ./dump.sql
|
|
||||||
#
|
|
||||||
# usage: ynh_psql_dump_db --database=database
|
# usage: ynh_psql_dump_db --database=database
|
||||||
# | arg: -d, --database= - the database name to dump
|
# | arg: -d, --database= - the database name to dump
|
||||||
# | ret: the psqldump output
|
# | ret: the psqldump output
|
||||||
#
|
#
|
||||||
|
# example: ynh_psql_dump_db 'roundcube' > ./dump.sql
|
||||||
|
#
|
||||||
# Requires YunoHost version 3.5.0 or higher.
|
# Requires YunoHost version 3.5.0 or higher.
|
||||||
ynh_psql_dump_db() {
|
ynh_psql_dump_db() {
|
||||||
# Declare an array to define the options of this helper.
|
# Declare an array to define the options of this helper.
|
||||||
|
@ -243,7 +243,7 @@ ynh_psql_setup_db() {
|
||||||
local new_db_pwd=$(ynh_string_random) # Generate a random password
|
local new_db_pwd=$(ynh_string_random) # Generate a random password
|
||||||
# If $db_pwd is not provided, use new_db_pwd instead for db_pwd
|
# If $db_pwd is not provided, use new_db_pwd instead for db_pwd
|
||||||
db_pwd="${db_pwd:-$new_db_pwd}"
|
db_pwd="${db_pwd:-$new_db_pwd}"
|
||||||
|
|
||||||
ynh_psql_create_user "$db_user" "$db_pwd"
|
ynh_psql_create_user "$db_user" "$db_pwd"
|
||||||
elif [ -z $db_pwd ]; then
|
elif [ -z $db_pwd ]; then
|
||||||
ynh_die --message="The user $db_user exists, please provide his password"
|
ynh_die --message="The user $db_user exists, please provide his password"
|
||||||
|
@ -286,11 +286,12 @@ ynh_psql_remove_db() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a master password and set up global settings
|
# Create a master password and set up global settings
|
||||||
# It also make sure that postgresql is installed and running
|
|
||||||
# Please always call this script in install and restore scripts
|
|
||||||
#
|
#
|
||||||
# usage: ynh_psql_test_if_first_run
|
# usage: ynh_psql_test_if_first_run
|
||||||
#
|
#
|
||||||
|
# It also make sure that postgresql is installed and running
|
||||||
|
# Please always call this script in install and restore scripts
|
||||||
|
#
|
||||||
# Requires YunoHost version 2.7.13 or higher.
|
# Requires YunoHost version 2.7.13 or higher.
|
||||||
ynh_psql_test_if_first_run() {
|
ynh_psql_test_if_first_run() {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue