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)
This commit is contained in:
Makoto Matsushita 2004-03-27 05:11:21 +00:00
parent 258beff3f6
commit 2cd3b95320
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=105401
2 changed files with 19 additions and 4 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= popfile
PORTVERSION= 0.21.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}

View file

@ -2,9 +2,24 @@
#
# $FreeBSD$
#
export POPFILE_ROOT=%%DATADIR%%
export POPFILE_USER=${HOME}/.popfile
case "${HOME}" in
"")
export POPFILE_USER_DEFAULT=/var/db/popfile
;;
*)
export POPFILE_USER_DEFAULT=${HOME}/.popfile
;;
esac
mkdir -p ${POPFILE_USER}
die()
{
echo "$1"
exit 1
}
export POPFILE_ROOT=%%DATADIR%%
export POPFILE_USER=${POPFILE_USER:-${POPFILE_USER_DEFAULT}}
mkdir -p ${POPFILE_USER} || die "mkdir ${POPFILE_USER} failed"
cd ${POPFILE_USER}
%%DATADIR%%/popfile.pl >/dev/null 2>&1 &