File zope-python-2.4.zpasswd of Package zope-python-2.4
#!/bin/sh
# SUSE zpasswd.py wrapper
#
# Copyright (c) 2004 SuSE Linux AG, Nuernberg, Germany.
#
# Authors: Michal Cihar <mcihar@suse.cz>
if [ "$1" = -h -o "$1" = --help ] ; then
cat <<EOT
Usage: `basename $0` [inituser|access] [instance] [options]
inituser|access
- whether to create inituser or access (default is access)
instance
- identifies your zope instance
- if not specified, default is used
- path can be asolute or relative to /var/opt/zope
options:
-u / --username=
Set the username to be used for the initial user or the emergency user
-p / --password=
Set the password
-e / --encoding=
Set the encryption/encoding rules. Defaults to SHA-1. OPTIONAL
-d / --domains=
Set the domain names that the user user can log in from. Defaults to
any. OPTIONAL.
EOT
exit 1
fi
FILE=access
case "$1" in
inituser)
FILE=inituser
shift
;;
access)
FILE=access
shift
;;
esac
INSTANCE=/var/opt/zope/default
if [ "$1" ] ; then
case "$1" in
-*)
;;
*)
if [ -d "$1" ] ; then
INSTANCE="$1"
elif [ -d "/var/opt/zope/$1" ] ; then
INSTANCE="/var/opt/zope/$1"
else
echo "Invalid instance path: '$1'"
exit 2
fi
shift
;;
esac
fi
exec /opt/zope/bin/zpasswd.py "$@" "$INSTANCE/$FILE"