improve scripts' contribution to setup

This commit is contained in:
eehouse111999 2020-02-07 14:37:27 -08:00
parent ac4baff7e7
commit c50e85f34a
2 changed files with 13 additions and 1 deletions

View file

@ -276,6 +276,7 @@ REQUIRED_DEBS = gcc libgtk-3-dev \
libcurl4-openssl-dev \
libjson-c-dev \
libgtk-3-dev \
python3-requests \
.PHONY: debcheck debs_install

View file

@ -17,7 +17,18 @@ usage() {
echo "usage: $0 start | stop | restart | mkdb | debs_install"
}
setup_user() {
sudo -u postgres createuser --createdb $USER || true
if id | grep -q postgres; then
echo "user $USER already member of postgres group"
else
echo "adding $USER to group postgres; will need to login again to take advantage"
sudo usermod -a -G postgres $USER
fi
}
make_db() {
setup_user
if [ ! -e $CONFFILE ]; then
echo "unable to find $CONFFILE"
exit 1
@ -116,7 +127,7 @@ do_start() {
}
install_debs() {
sudo apt-get install postgresql-client postgresql
sudo apt-get install postgresql-client postgresql libpq-dev
}
case $1 in