diff options
Diffstat (limited to 'shells/psh/pkg-deinstall')
-rw-r--r-- | shells/psh/pkg-deinstall | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/shells/psh/pkg-deinstall b/shells/psh/pkg-deinstall new file mode 100644 index 000000000000..ad9fcef929e1 --- /dev/null +++ b/shells/psh/pkg-deinstall @@ -0,0 +1,22 @@ +#!/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 |