/
bareos-database-common.postinst.in
66 lines (53 loc) · 1.92 KB
/
bareos-database-common.postinst.in
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
58
59
60
61
62
63
64
65
66
#!/bin/sh
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#set -x
#echo "bareos-database-common.postinst: $@" >&2
. /usr/share/debconf/confmodule
if [ -r @scriptdir@/bareos-config-lib.sh ]; then
. @scriptdir@/bareos-config-lib.sh
if [ -f /usr/share/dbconfig-common/dpkg/postinst ]; then
. /usr/share/dbconfig-common/dpkg/postinst
dbc_debug=1
# action
if [ $# -gt 0 ]; then
param1="$1"
shift
fi
# when action is "configure": most-recently-configured-version
if [ $# -gt 0 ]; then
param2="$1"
shift
fi
if [ "$param2" ]; then
case "$param1" in
configure|reconfigure)
param2=`get_database_version_by_release "$param2"`
;;
*)
;;
esac
fi
# dbc_pgsql_createdb_encoding: required for postgresql
dbc_pgsql_createdb_encoding="SQL_ASCII"
# dbc_dbfile_owner: only required for sqlite3
dbc_dbfile_owner=`get_user_dir`:`get_group_dir`
# substitution is only done on installs, not on updates!
#dbc_sql_substitutions="yes"
# run dbconfig
dbc_go bareos-database-common $param1 $param2 $@
# apply the dbconfig settings, ignore errors
@scriptdir@/bareos-config apply_dbconfig_settings || true
fi
fi
#DEBHELPER#