sogo/packaging/debian-multiarch/sogo.preinst
Jean Raby c36eafc69c Move packaging stuff to its own subdirectory
Monotone-Parent: 0a2787d6259826c9137c4fbee005b7cf638fa317
Monotone-Revision: d538a70c8651aa1849c88eedda7782a21b41b591

Monotone-Author: jraby@inverse.ca
Monotone-Date: 2012-08-02T17:40:27
2012-08-02 17:40:27 +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