This file is indexed.

postinst is in samba4 4.0.0~alpha18.dfsg1-4ubuntu2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
#!/bin/sh -e

. /usr/share/debconf/confmodule

if [ "$1" = "configure" ]; then
	db_get samba4/server-role || true
	SERVER_ROLE="$RET"
	db_get samba-common/workgroup || true
	DOMAIN="$RET"
	db_get samba4/realm || true
	REALM="$RET"
	# FIXME: Urgh.. ideally samba-tool would be able to update this:
	# Update realm setting and server role setting
	/usr/share/samba/setoption.pl "realm" "${REALM}"
	/usr/share/samba/setoption.pl "server role" "${SERVER_ROLE}"

	# See if we're upgrading from Samba 3
	if [ ! -z "$2" ]; then
		if dpkg --compare-versions "$2" lt "3.9.0"; then
			db_get samba4/upgrade-from-v3 || true
			if [ "$RET" = "true" ]; then
				/usr/share/samba/setup/upgrade --realm="$REALM" \
				    /var/lib/samba /etc/samba/smb.conf.samba3
			fi
		else
			# Upgrade from previous Samba 4 installation
			if [ -f /etc/samba/smb.conf ]; then
				/usr/share/samba/setup/upgradeprovision --full
			fi
		fi
	else
		# Install from scratch
 		# FIXME: if server role == dc, make sure that there are sysvol and
 		# netlogon shares.
		/usr/share/samba/setup/provision --realm="$REALM" --domain="$DOMAIN" \
		    --server-role="$SERVER_ROLE"
	fi
fi

# Automatically added by dh_installinit
if [ -e "/etc/init/samba4.conf" ]; then
	invoke-rc.d samba4 start || exit $?
fi
# End automatically added section


db_stop

exit 0