From 447582ed29ac8b249f0474f9e565db0e31406cdd Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Mon, 24 Jul 2023 10:15:27 -0400 Subject: [PATCH] Only match first major number of postgres `postgres --version` returns: postgres (PostgreSQL) 13.10 Which the regex matches both the 13 and the 10 and caused postgres init to attempt to update the database version and then fail. --- images/s6_assets/init/postgres-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/s6_assets/init/postgres-init b/images/s6_assets/init/postgres-init index 86711211..23b990f5 100755 --- a/images/s6_assets/init/postgres-init +++ b/images/s6_assets/init/postgres-init @@ -13,7 +13,7 @@ export C035="\e[35m" export C036="\e[36m" export C037="\e[37m" -PGVERSION=$(postgres --version | egrep -o "1[0-9]") +PGVERSION=$(postgres --version | egrep -o "1[0-9]" | head -n1) PGHOME="/var/lib/pgsql" PGDATA="${PGHOME}/data" PGDATA_OLD="${PGHOME}/data_old"