-
Notifications
You must be signed in to change notification settings - Fork 3
/
gkutil.sh
executable file
·39 lines (29 loc) · 1.54 KB
/
gkutil.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Copyright (C) 2013, 2014, 2015, 2016 Digital Freedom Foundation
# Copyright (C) 2017, 2018 Digital Freedom Foundation & Accion Labs
# This file is part of GNUKhata:A modular,robust and Free Accounting System.
# GNUKhata is Free Software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation; either version 3 of
# the License, or (at your option) any later version.and old.stockflag = 's'
# GNUKhata is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public
# License along with GNUKhata (COPYING); if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA59 Temple Place, Suite 330,
# Contributor:
# "Ishan Masdekar " <imasdekar@dff.org.in>
sudo useradd -s /bin/bash -m gkadmin
echo 'Created user gkadmin'
sudo -u postgres psql -c "create role gkadmin with login"
echo 'Role gkadmin created'
sudo -u postgres psql -c "alter role gkadmin createdb;"
echo 'Granted database creation privileges to role sttpadmin'
sudo -u postgres psql -c "grant all privileges on database template1 to gkadmin;"
echo 'Granted all privileges to role gkadmin'
sudo -u postgres psql -c "create database gkdata"
sudo chown gkadmin .
echo 'Created gkdata database '