#! /bin/sh

set -e

case $1 in configure)
	case $2 in '')
		secret=/etc/squarepeg/secret.cfg
		if [ ! -e $secret ]
		then
			umask 027
			touch $secret
			chgrp www-data $secret || :
			echo "# automatically created during postinst" >$secret
			echo "CryptoSecret $(makepasswd --chars=64)" >>$secret
			umask 022
		fi
	esac
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
