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

PSH="${PKG_PREFIX-/usr/local}/bin/psh"
SHELLS="${PKG_DESTDIR-}/etc/shells"

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