Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
upgrade-postgresql: Use jq rather than grep to check cluster status.
Alex Vandiver40e5a12e3c55
diff --git a/scripts/setup/upgrade-postgresql b/scripts/setup/upgrade-postgresqlindex 1bf36f87bdc..3302cac04d9 100755--- a/scripts/setup/upgrade-postgresql+++ b/scripts/setup/upgrade-postgresql@@ -25,7 +25,12 @@ set -x"$ZULIP_PATH"/scripts/lib/setup-apt-repoapt-get install -y "postgresql-$UPGRADE_TO" "postgresql-client-$UPGRADE_TO"-if pg_lsclusters -h | grep -qE "^$UPGRADE_TO\s+main\b"; then+drop_main_cluster="$(+ pg_lsclusters --json \+ | jq --arg pg_version "$UPGRADE_TO" -r \+ '.[] | select((.version|tostring == $ARGS.named.pg_version) and (.cluster == "main")) | .cluster'+)"+if [ -n "$drop_main_cluster" ]; thenpg_dropcluster "$UPGRADE_TO" main --stopfi