freebsd-ports/shells/bash/pkg-install
Gabor Kovesdan 42542fb076 - Remove the DESTDIR modifications from individual ports as we have a new,
fully chrooted DESTDIR, which does not need such any more.

Sponsored by:	Google Summer of Code 2007
Approved by:	portmgr (pav)
2007-08-04 11:41:30 +00:00

27 lines
669 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
BASH="$(echo ${PKG_PREFIX-/usr/local}/bin/bash | /usr/bin/sed -e 's|//|/|g')"
RBASH="$(echo ${PKG_PREFIX-/usr/local}/bin/rbash | /usr/bin/sed -e 's|//|/|g')"
SHELLS="/etc/shells"
case $2 in
POST-INSTALL)
if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$BASH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
echo "$BASH" >> "$SHELLS"
else
echo "Not root, please add $BASH to $SHELLS manually"
fi
fi
if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$RBASH\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
echo "$RBASH" >> "$SHELLS"
else
echo "Not root, please add $RBASH to $SHELLS manually"
fi
fi
;;
esac