freebsd-ports/shells/heirloom-sh/pkg-install
Martin Wilke ceabe272a7 Heirloom-sh is a portable version of OpenSolaris' #!/bin/sh.
If one need to write portable shell scripts, this one is excellent for
testing them. It is installed as jsh (job shell).

Other OpenSolaris user land tools are available in sysutils/heirloom

WWW: http://heirloom.sourceforge.net/sh.html

PR:		ports/122192
Submitted by:	Danijel Tasov <danielt at pilgerer.org>
2008-04-29 21:34:02 +00:00

19 lines
370 B
Bash

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