Fixed #20269 -- Adapted PostGIS template create script for CentOS/RHEL

Thanks Stephane Benchimol for the report and the initial script and
mfandreas for the patch.