aboutsummaryrefslogtreecommitdiffstats
path: root/shells/bash/pkg-deinstall
blob: 11ee3aff420d0e906c2d1ebf18a6bbd80b3cc8bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
#
# $FreeBSD$
#

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