sogo/debian-multiarch/sogo.preinst
Wolfgang Sourdeau be172c6d05 Split multiarch build in debian-multiarch for new distros
Monotone-Parent: c50f677f6d597a2c063db713c6e8af3961c44b34
Monotone-Revision: 28e6e54b234c882f7da005f4413e9a5beeae28ef

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-04-10T15:35:51
Monotone-Branch: ca.inverse.sogo
2012-04-10 15:35:51 +00:00

33 lines
763 B
Bash

#!/bin/bash
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
if test "x$1" == "xinstall" && test -z "$2"
then
if ! id sogo 1> /dev/null 2>&1; then
groupadd -f -K GID_MIN=100 -K GID_MAX=500 sogo
useradd -d /home/sogo -g sogo -m -K UID_MIN=100 -K UID_MAX=500 -K PASS_MAX_DAYS=-1 -s /bin/bash sogo
fi
for dir in run spool log
do
if ! test -d /var/$dir/sogo
then
install -m 750 -o sogo -g sogo -d /var/$dir/sogo
fi
done
fi
#DEBHELPER#
exit 0