Created
December 10, 2019 19:50
-
-
Save dlangille/b67a08be9a7eb360f9ab696b56a2d586 to your computer and use it in GitHub Desktop.
Locate the data directory for PostgreSQL on FreeBSD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./get_postgresql_data | |
/var/db/postgres/data12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/bin/sh | |
CONFIGURED=`sysrc -qn postgresql_data` | |
if [ "$?" == "1" ]; then | |
VERSION=`pkg info | grep -i 'PostgreSQL database' | cut -b 11,12` | |
if [ "$VERSION" == "" ]; then | |
# we have nothing | |
exit 1 | |
fi | |
CONFIGURED="/var/db/postgres/data$VERSION" | |
fi | |
echo $CONFIGURED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment