summaryrefslogtreecommitdiff
path: root/mail/popfile/files
diff options
context:
space:
mode:
authorMakoto Matsushita <matusita@FreeBSD.org>2004-03-27 05:11:21 +0000
committerMakoto Matsushita <matusita@FreeBSD.org>2004-03-27 05:11:21 +0000
commit2cd3b953205fc6686fac10c22330d89ab694e871 (patch)
tree8da7d33ed24a9352612db1af09b16e06652ce7bd /mail/popfile/files
parentMore chances to catch correct PID. (diff)
New features to popfile.sh startup script, including:
- The default working directory can be tweaked by user; if POPFILE_USER variable is defined before, use it simply. - If POPFILE_USER variable is not defined, the script default is either ${HOME}/.popfile (old default) or /var/db/popfile if ${HOME} variable is not defined or defined as null string. - If ${POPFILE_USER} directory cannot be made, exit with error. Most casual users shouldn't affect this change, however, the script itself is changed, so bump PORTREVISION. Inspired from: http://home.jp.freebsd.org/cgi-bin/showmail/ports-jp/14635 (in Japanese)
Notes
Notes: svn path=/head/; revision=105401
Diffstat (limited to 'mail/popfile/files')
-rw-r--r--mail/popfile/files/popfile.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/mail/popfile/files/popfile.sh b/mail/popfile/files/popfile.sh
index ad7345fd456c..21caf2b8fe51 100644
--- a/mail/popfile/files/popfile.sh
+++ b/mail/popfile/files/popfile.sh
@@ -2,9 +2,24 @@
#
# $FreeBSD$
#
+case "${HOME}" in
+"")
+ export POPFILE_USER_DEFAULT=/var/db/popfile
+ ;;
+*)
+ export POPFILE_USER_DEFAULT=${HOME}/.popfile
+ ;;
+esac
+
+die()
+{
+ echo "$1"
+ exit 1
+}
+
export POPFILE_ROOT=%%DATADIR%%
-export POPFILE_USER=${HOME}/.popfile
+export POPFILE_USER=${POPFILE_USER:-${POPFILE_USER_DEFAULT}}
-mkdir -p ${POPFILE_USER}
+mkdir -p ${POPFILE_USER} || die "mkdir ${POPFILE_USER} failed"
cd ${POPFILE_USER}
%%DATADIR%%/popfile.pl >/dev/null 2>&1 &