diff --git a/help.sh b/help.sh index 8fc8851c..1d75a003 100755 --- a/help.sh +++ b/help.sh @@ -80,13 +80,13 @@ psql -l >/dev/null 2>/dev/null && echo "OK: Connected to postgres" || echo "FAILED: Unable to connect to postgres" -if psql -l 2>/dev/null | grep wrolpi >/dev/null; then +if sudo -u wrolpi psql -l 2>/dev/null | grep wrolpi >/dev/null; then echo "OK: Found wrolpi database" - if psql wrolpi -c '\d' | grep "file_group" >/dev/null; then + if sudo -u wrolpi psql wrolpi -c '\d' | grep "file_group" >/dev/null; then echo "OK: WROLPi database is initialized" - if [ "$(psql wrolpi -c 'copy (select count(*) from file_group) to stdout')" -gt 0 ]; then + if [ "$(sudo -u wrolpi psql wrolpi -c 'copy (select count(*) from file_group) to stdout')" -gt 0 ]; then echo "OK: WROLPi database has files" else echo "FAILED: WROLPi database has no files" @@ -184,10 +184,10 @@ fi echo # Map -if psql -l 2>/dev/null | grep gis >/dev/null; then +if sudo -u _renderd psql -l 2>/dev/null | grep gis >/dev/null; then echo "OK: Found map database" - if psql gis -c '\d' | grep water_polygons >/dev/null; then + if sudo -u _renderd psql gis -c '\d' | grep water_polygons >/dev/null; then echo "OK: Map database is initialized" else echo "FAILED: Map database is not initialized"