summaryrefslogtreecommitdiff
path: root/extra/pdksh/pdksh.install
blob: 17463a17ee5d509d36be4d5f821b868e4a1e28e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
post_install() {
  if [ ! "$(grep /bin/ksh etc/shells)" ]; then
    echo "updating /etc/shells... done."
    sed -i "s|/bin/bash|/bin/bash\n/bin/ksh|" etc/shells
  else
    sed -i "s|/usr/bin/ksh|/bin/ksh|" etc/shells

    echo ""
    echo ">> WARNING: /usr/bin/ksh has moved to /bin/ksh,"
    echo ">> please update your user accounts as needed"
    echo ""
  fi
}

post_upgrade() {
  post_install $1
}

pre_remove() {
  echo -ne "\nupdating /etc/shells... "
  sed -i "s|/bin/ksh||" etc/shells
}