>> # set defaults
>> postgresql_enable=${postgresql_enable:-"NO"}
>> postgresql_flags=${postgresql_flags:-"-w -s -m fast"}
Try it without the "-w" ... that's probably causing it to try to connect
with psql.
Alternatively, set up a ~/.pgpass file for the postgres user (which
might be a reasonable thing anyway).
BTW, this script seems fairly brain-dead in assuming that the same
option flags should apply to all pg_ctl commands.
regards, tom lane