openbsd-ports/net/tacacs+/pkg/INSTALL
sturm d1c14e1132 update to new naming schema
bump PKGNAME

Srebrenko Sehic ok
2003-06-22 17:08:08 +00:00

53 lines
1.1 KiB
Plaintext

#!/bin/sh
# $OpenBSD: INSTALL,v 1.2 2003/06/22 17:08:08 sturm Exp $
#
# Pre/post-installation setup of tacacs
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
ID=511
do_usergroup_install()
{
# Create tacacs user and group
groupinfo -e ${TACACSGROUP}
if [ $? -eq 0 ]; then
echo "===> Using ${TACACSGROUP} group for tacacs"
else
echo "===> Creating ${TACACSGROUP} group for tacacs"
groupadd -g ${ID} ${TACACSGROUP}
fi
userinfo -e ${TACACSUSER}
if [ $? -eq 0 ]; then
echo "===> Using ${TACACSUSER} user for tacacs"
else
echo "===> Creating ${TACACSUSER} user for tacacs"
useradd -g ${TACACSGROUP} -d /nonexistent -c 'TACACS+ user' \
-s /sbin/nologin -u ${ID} ${TACACSUSER}
fi
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
do_usergroup_install
;;
POST-INSTALL)
: Nothing to be done.
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0