Skip to content

Commit b89e0b4

Browse files
committed
check if user exists before creating
1 parent f06f895 commit b89e0b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

createuser.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
createuser -S -D -R -U postgres libertree
1+
if echo "\dg" | psql -U postgres | grep -wq libertree; then
2+
echo "User already exists: libertree"
3+
else
4+
createuser -S -D -R -U postgres libertree
5+
fi

0 commit comments

Comments
 (0)