1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00
freebsd-ports/shells/bash-devel/pkg-install
Emanuel Haupt 46a134caae Add shells/bash-devel. The goal of this port is to have a more up to date
version of shells/bash.

This port has also been converted to use OPTIONSng.
2013-01-14 11:47:17 +00:00

28 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