mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
improve scripts' contribution to setup
This commit is contained in:
parent
ac4baff7e7
commit
c50e85f34a
2 changed files with 13 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue