diff options
Diffstat (limited to 'shells/bash-devel/pkg-install')
-rw-r--r-- | shells/bash-devel/pkg-install | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/shells/bash-devel/pkg-install b/shells/bash-devel/pkg-install new file mode 100644 index 000000000000..99417b66ba6e --- /dev/null +++ b/shells/bash-devel/pkg-install @@ -0,0 +1,27 @@ +#!/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 |