File: gm-bootstrap_server

package info (click to toggle)
gnumed-server 21.11-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 45,408 kB
  • ctags: 3,891
  • sloc: sql: 1,210,640; python: 13,526; sh: 1,476; makefile: 19
file content (57 lines) | stat: -rwxr-xr-x 1,967 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash

# if any GNUmed database is available ...
if psql -l | grep -qi gnumed ; then
  # ... ask user whether he has injected organisation + unit
  cat <<EOT
========================================================================

Before upgrading your existing GNUmed database v18 to the v19 schema it
is very advisable to make sure you have created (by using the 1.3
client) -- an organization and a unit thereof to serve as your praxis
and praxis location. During the very first start of the 1.4 client you
will be asked which organization/unit represents your praxis/location.

Did you have definte organization and unit thereof?

EOT
  read -e -p "[y / N]: "
  if test "${REPLY}" = "y" ; then
    echo "OK. Start upgrading server."
  else
    echo "Upgrading aborted by user."
    exit 1
  fi
fi

#==============================================================
# This wrapper is intended to be installed into a systemwide
# admin-only executable directory such as "/usr/sbin/"
#
# It should be run as root and will call the upstream script to
# actually bootstrap the latest database from scratch.
#
# author: Andreas Tille, Karsten Hilbert
# license: GPL v2 or later
#
#==============================================================
# those probably need some adjustment from package maintainers:

GM_LOG_BASE="/var/log/gnumed/server"
GM_SERVER_DIR="/var/lib/gnumed/server/bootstrap"

#==============================================================

# consider entirely removing this check, for example
# because it does not honour $GM_PORT
if ! su -c "psql -t -d template1 -c \"show lc_ctype;\"" -l postgres | grep -q -e C -e UTF-8 ; then
	echo "Your PostgreSQL installation seems not to have lc_ctype UTF-8 or C."
	echo "This will most probably lead to failures of the GNUmed server installation."
fi

cd ${GM_SERVER_DIR}
mkdir -p ${GM_LOG_BASE}
export GM_LOG_BASE
./bootstrap-latest.sh

#==============================================================