Mark
Mark

Reputation: 3738

Modifying pg_hba.conf

I want to modify the line

local all all peer

to

local all all md5

within a shell script. What is the best way to go about this? If I am to search for the line, what string should I be looking for? There are a lot of spaces between each word in the pg_hba.conf

Or is there a better way at doing this?

Thank you

Upvotes: 2

Views: 1457

Answers (1)

Jasen
Jasen

Reputation: 12412

sed -i  '/^local all all peer/ s/peer/md5/' pg_hba.conf

Upvotes: 4

Related Questions