mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Using wrolpi user to check for database in help script.
This commit is contained in:
parent
8230174fcd
commit
51453ad6cc
1 changed files with 5 additions and 5 deletions
10
help.sh
10
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue