freebsd-ports/shells/psh/pkg-deinstall
Cheng-Lung Sung cab771a7f9 - Change the way used to add/remove the shell on /etc/shells,
use pkg-install and pkg-deinstall (both stoled from shells/bash)
  to do it.
- Remove pre-install section, it's not more needed on this version,
  because Makefile is created correctly changing Makefile.PL

PR:		80583
Submitted by:	Renato Botelho (maintainer)
2005-05-04 05:47:17 +00:00

23 lines
432 B
Bash

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