File: pybit-web.config

package info (click to toggle)
pybit 1.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,512 kB
  • sloc: python: 5,088; xml: 497; sh: 411; perl: 349; sql: 197; makefile: 82
file content (52 lines) | stat: -rw-r--r-- 1,188 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
#!/bin/sh
set -e

# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

# This conf script is capable of backing up
db_capb backup

ucf -p /etc/pybit/debian-db.pl
if [ -f /etc/pybit/debian-db.pl ]; then
  rm /etc/pybit/debian-db.pl
fi
# source debconf stuff
. /usr/share/debconf/confmodule
# source dbconfig-common stuff
. /usr/share/dbconfig-common/dpkg/config.pgsql

# create an output file which ucf will watch
# (and ensure isn't recreated) until we need to do it
dbc_generate_include=perl:/etc/pybit/debian-db.pl
# minimal permissions
dbc_generate_include_owner="root:root"
dbc_generate_include_perms="600"
# do the dbconfig stuff
dbc_go pybit-web $@
# now do our config
STATE=1
while [ "$STATE" != 0 -a "$STATE" != 3 ]; do
	case "$STATE" in
	1)
		db_input high pybit-web/rabbitmqhost || true
	;;
	2)
		# Check their answer.
		db_get pybit-web/rabbitmqhost
		if [ "$RET" = "" ]; then
			db_set pybit-web/rabbitmqhost localhost
			db_input high pybit-web/missinghost || true
			db_go
		fi
		db_input medium pybit-web/hostname || true
		db_input medium pybit-web/port || true
	;;
	esac
	if db_go; then
		STATE=$(($STATE + 1))
	else
		STATE=$(($STATE - 1))
	fi
done