File: nova-consoleproxy.postinst

package info (click to toggle)
nova 2%3A32.1.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,456 kB
  • sloc: python: 418,873; pascal: 1,848; sh: 991; makefile: 163; xml: 83
file content (27 lines) | stat: -rwxr-xr-x 649 bytes parent folder | download | duplicates (8)
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
#!/bin/sh

set -e

DEF_FILE=/etc/default/nova-consoleproxy

if [ "${1}" = "configure" ] || [ "$1" = "reconfigure" ] ; then
	if [ ! -e ${DEF_FILE} ] && [ -r /usr/share/nova-consoleproxy/default ] ; then
		cp /usr/share/nova-consoleproxy/default ${DEF_FILE}
	fi
	if [ ! -r ${DEF_FILE} ] ; then
		exit 0
	fi

	. /usr/share/debconf/confmodule
	db_get nova-consoleproxy/daemon_type
	DAEMON_TYPE=$RET
	if ! grep -E -q "^[- \t]*NOVA_CONSOLE_PROXY_TYPE=" ${DEF_FILE} ; then
		echo "xenapi_connection_url=" >> ${DEF_FILE}
	fi
	sed -i "s#^[- \t]*NOVA_CONSOLE_PROXY_TYPE=.*#NOVA_CONSOLE_PROXY_TYPE=${DAEMON_TYPE}#" ${DEF_FILE}
	db_stop
fi

#DEBHELPER#

exit 0