This file is indexed.

postinst is in ratbox-services-sqlite 1.2.4+repack-1.

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

set -e

DATABASE_DIR=/var/lib/ratbox-services
DATABASE=$DATABASE_DIR/ratbox-services.db
OLD_DATABASE=/etc/ratbox-services/ratbox-services.db
SCHEMA=/usr/share/ratbox-services/database/schema-sqlite.sql

if [ ! -e $DATABASE ] ; then
	echo -n "Creating $DATABASE"
	# Assuming some admin deleted the directory...
	mkdir -p $DATABASE_DIR
	# The database was previously badly locayed in /etc (upstream behaviour)
	if [ -e $OLD_DATABASE ]; then
		mv $OLD_DATABASE $DATABASE
	else
		sqlite3 $DATABASE < $SCHEMA
	fi
	chown -R irc:irc $DATABASE_DIR
	echo "."
fi