File: fetchmail.postinst

package info (click to toggle)
fetchmail 6.4.39-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,572 kB
  • sloc: ansic: 30,550; sh: 6,533; python: 2,230; perl: 564; yacc: 459; lex: 285; makefile: 262; awk: 124; lisp: 84; exp: 43; sed: 16
file content (31 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
#
# Postinst script for fetchmail
# $Id: fetchmail.postinst 469 2008-05-18 12:47:05Z nion $
#

set -e

# Create fetchmail user and its homedir if we may need it
if ! getent passwd fetchmail >/dev/null; then
	adduser --system --ingroup nogroup --home /var/lib/fetchmail \
	--shell /bin/false --disabled-password fetchmail
fi

# if the login shell is not /bin/false, change this, see #481727
LOGINSH=$(getent passwd fetchmail | cut -d ':' -f 7)
if [ "x$LOGINSH" != "x/bin/false" ]; then
	chsh -s /bin/false fetchmail
fi

if ! [ -d /var/lib/fetchmail ]; then
    mkdir -p /var/lib/fetchmail
fi
chmod 700 /var/lib/fetchmail
chown -h -R fetchmail:nogroup /var/lib/fetchmail

#DEBHELPER#

exit 0

# vim:ts=4:sw=4: