[ciderwebmail] 04/06: Fix declare /home/jonas when creating user, and tidy postinst and postrm scripts while at it. Thanks to lintian.
Jonas Smedegaard
dr at jones.dk
Thu Oct 23 15:03:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch experimental
in repository ciderwebmail.
commit 9e8dec43063c4f3438789862e56518f621feaa21
Author: Jonas Smedegaard <dr at jones.dk>
Date: Thu Oct 23 16:23:26 2014 +0200
Fix declare /home/jonas when creating user, and tidy postinst and postrm scripts while at it. Thanks to lintian.
---
debian/postinst | 16 ++++++++++------
debian/postrm | 7 +++++--
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/debian/postinst b/debian/postinst
index 270df70..ae5d536 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -2,14 +2,18 @@
set -e
+user="ciderwebmail"
+home="/var/lib/$user"
+
if [ "$1" = "configure" ]; then
- adduser --system --quiet --group --no-create-home ciderwebmail || :
- if [ ! -e /var/lib/ciderwebmail ]; then
- mkdir /var/lib/ciderwebmail
+ adduser --system --quiet --group \
+ --home "$home" --no-create-home "$user" || :
+ if [ ! -e "$home" ]; then
+ mkdir "$home"
fi
- chown ciderwebmail: /var/lib/ciderwebmail
- if [ -f /var/lib/ciderwebmail/user_settings.sql ]; then
- chown ciderwebmail: /var/lib/ciderwebmail/user_settings.sql
+ chown "$user": "$home"
+ if [ -f "$home"/user_settings.sql ]; then
+ chown "$user": "$home"/user_settings.sql
fi
fi
diff --git a/debian/postrm b/debian/postrm
index 812e8ab..f53d2d3 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -4,7 +4,10 @@ set -e
#DEBHELPER#
+user="ciderwebmail"
+home="/var/lib/$user"
+
if [ "$1" = "purge" ]; then
- deluser --system --quiet ciderwebmail || true
- rm -rf /var/lib/ciderwebmail
+ deluser --system --quiet "$user" || true
+ rm -rf "$home"
fi
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/ciderwebmail.git
More information about the Pkg-perl-cvs-commits
mailing list