pkg-deinstall

#!/bin/sh
#
# $FreeBSD: ports/shells/bashc/pkg-deinstall,v 1.1 2008/03/11 22:38:46 alepulver Exp $
#

BASHC="$(echo ${PKG_PREFIX-/usr/local}/bin/bashc | /usr/bin/sed -e 's|//|/|g')"
SHELLS="${PKG_DESTDIR-}/etc/shells"

case $2 in
DEINSTALL)
if grep -qs "^$BASHC\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
TMPSHELLS=`mktemp -t shells`
grep -v "^$BASHC\$" "$SHELLS" > "$TMPSHELLS"
cat "$TMPSHELLS" > "$SHELLS"
rm "$TMPSHELLS"
else
echo "Not root, please remove $BASHC from $SHELLS manually"
fi
fi
;;
esac

pkg-descr

Bash Commander is a traditional GNU bash shell extended with visual two-panel
file browser.

Features:

* Full bash compatibility.
* Embedded visual file browser.
* Two file panels, turned on and off by pressing ^O.
* Actions and colors configured via .bashrc script.
* Run current file on pressing Enter, configurable via commander_start_file()
shell function.
* Perform an action on pressing F1-F20 keys, configurable via commander_fN()
shell functions.

WWW: http://groups.google.com/group/bashc/web/overview

pkg-install

#!/bin/sh
#
# $FreeBSD: ports/shells/bashc/pkg-install,v 1.1 2008/03/11 22:38:46 alepulver Exp $
#

BASHC="$(echo ${PKG_PREFIX-/usr/local}/bin/bashc | /usr/bin/sed -e 's|//|/|g')"
SHELLS="/etc/shells"

case $2 in
POST-INSTALL)
if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$BASHC\$" "$SHELLS"; then
if [ `id -u` -eq 0 ]; then
echo "$BASHC" >> "$SHELLS"
else
echo "Not root, please add $BASHC to $SHELLS manually"
fi
fi
;;
esac