Fall back to password from general-settings
Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
parent
70a36d805f
commit
ca231ac539
1 changed files with 5 additions and 7 deletions
10
create-db
10
create-db
|
@ -55,9 +55,10 @@ case $key in
|
||||||
echo "OPTIONS"
|
echo "OPTIONS"
|
||||||
echo " -u, --user User the database will be owned by."
|
echo " -u, --user User the database will be owned by."
|
||||||
echo " NOTE: If not given, the one from the general-settings will be used"
|
echo " NOTE: If not given, the one from the general-settings will be used"
|
||||||
echo " -H, --host Database host name"
|
echo " -H, --host Database host name. Default: localhost"
|
||||||
|
echo " -p, --password Authenticate via password, default. Password for the postgres user"
|
||||||
|
echo " NOTE: If not given, the one from the general-settings will be used"
|
||||||
echo " -s, --sudo Authenticate via sudo, databases on localhost only"
|
echo " -s, --sudo Authenticate via sudo, databases on localhost only"
|
||||||
echo " -p, --password Authenticate via password. Password for the postgres user"
|
|
||||||
echo " -h, --help Shows this help and exit"
|
echo " -h, --help Shows this help and exit"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
@ -86,11 +87,8 @@ if [ ! -z "$man_user" ]; then
|
||||||
db_user="$man_user"
|
db_user="$man_user"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$auth" = "pw" ]; then
|
|
||||||
if [ -z "$pw" ]; then
|
if [ -z "$pw" ]; then
|
||||||
echo "ERROR: No password or --sudo flag given"
|
export PGPASSWORD="$db_passwd"
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$auth" = "sudo" ]; then
|
if [ "$auth" = "sudo" ]; then
|
||||||
|
|
Loading…
Reference in a new issue