From 6d73b167168699f4ca67f927d125f0be46e9aad9 Mon Sep 17 00:00:00 2001 From: pfcoder Date: Fri, 1 May 2020 21:58:52 +0800 Subject: [PATCH 1/2] fix shell quotation error of server db-init.sh --- server/db-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/db-init.sh b/server/db-init.sh index c9150e9d..87f39ead 100755 --- a/server/db-init.sh +++ b/server/db-init.sh @@ -37,7 +37,7 @@ done psql -c "CREATE USER $username WITH PASSWORD '$password' SUPERUSER;" -U postgres -psql -c 'CREATE DATABASE $dbname WITH OWNER $username;' -U postgres +psql -c "CREATE DATABASE $dbname WITH OWNER $username;" -U postgres export LEMMY_DATABASE_URL=postgres://$username:$password@localhost:$port/$dbname echo $LEMMY_DATABASE_URL From 8d4ab4555cbf026ea2c34ea4800f72dcd1fe4c8e Mon Sep 17 00:00:00 2001 From: Richie Zhang <12566991+StaticallyTypedRice@users.noreply.github.com> Date: Fri, 1 May 2020 07:33:28 -0700 Subject: [PATCH 2/2] Improve the yes/no prompt in install.sh (#683) * Improve the yes/no prompt in install.sh The old implementation used a feature only present on Bash version 4, which not all systems have. The new version should work on all bash shells. * Update install.sh --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index ad3e4ab3..d84761a2 100755 --- a/install.sh +++ b/install.sh @@ -16,10 +16,10 @@ init_db_final=0 while [ "$init_db_valid" == 0 ] do read -p "Initialize database (y/n)? " init_db - case "${init_db,,}" in - y|yes ) init_db_valid=1; init_db_final=1;; - n|no ) init_db_valid=1; init_db_final=0;; - * ) echo "Invalid input" 1>&2;; + case "$init_db" in + [yY]* ) init_db_valid=1; init_db_final=1;; + [nN]* ) init_db_valid=1; init_db_final=0;; + * ) echo "Invalid input. Please enter either \"y\" or \"n\"." 1>&2;; esac echo done