postgresql: make post-install idempotent
This commit is contained in:
parent
ffbf7a45cb
commit
3528c446fb
@ -8,6 +8,8 @@ ID=42
|
||||
getent group ${GROUP} >/dev/null || groupadd -r ${GROUP}
|
||||
getent passwd ${USER} >/dev/null || useradd -u $ID -d ${HOME} -g ${GROUP} -s /bin/false ${USER}
|
||||
|
||||
test -d ${HOME} && exit 0
|
||||
|
||||
install -d -o ${USER} -g ${GROUP} ${HOME}
|
||||
su -s /bin/sh -c "pg_ctl -D ${HOME} initdb" ${USER}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user