opnsense-ports/shells/heirloom-sh/pkg-deinstall
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

22 lines
471 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
JSH="$(echo ${PKG_PREFIX-/usr/local}/bin/jsh | /usr/bin/sed -e 's|//|/|g')"
SHELLS="${PKG_DESTDIR-}/etc/shells"
case $2 in
DEINSTALL)
if grep -qs "^$JSH\$" "$SHELLS"; then
if [ $(id -u) -eq 0 ]; then
TMPSHELLS=$(mktemp -t shells)
grep -v "^$JSH\$" "$SHELLS" > "$TMPSHELLS"
cat "$TMPSHELLS" > "$SHELLS"
rm "$TMPSHELLS"
else
echo "Not root, please remove $JSH from $SHELLS manually"
fi
fi
;;
esac