File: freezer-api.postinst.in

package info (click to toggle)
freezer-api 9.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,884 kB
  • sloc: python: 15,677; sh: 388; makefile: 56
file content (34 lines) | stat: -rwxr-xr-x 892 bytes parent folder | download
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
#!/bin/sh

set -e

CONF=/etc/freezer/freezer-api.conf

#PKGOS-INCLUDE#

if [ "${1}" = "configure" ] || [ "$1" = "reconfigure" ] ; then
	. /usr/share/debconf/confmodule
	. /usr/share/dbconfig-common/dpkg/postinst

	pkgos_var_user_group freezer /bin/sh

	# Create config files if they don't exist
	pkgos_write_new_conf freezer freezer-paste.ini
	pkgos_write_new_conf freezer policy.json
	pkgos_write_new_conf freezer freezer-api.conf

	db_get freezer-api/configure_db
	if [ "$RET" = "true" ] ; then
	pkgos_dbc_postinst --suite freezer ${CONF} database connection freezer-api $@
		echo "Now doing freezer manage db sync: this may take a while..."
		su freezer -s /bin/sh -c "freezer-manage db sync"
	fi
	pkgos_write_admin_creds ${CONF} keystone_authtoken freezer-api
	pkgos_register_endpoint_postinst freezer-api freezer backup "Freezer Backup Service" 9090 ""
	db_stop
fi

#DEBHELPER#

exit 0