post_install() {
  for _sh in {,/usr}/bin/{o,y}sh; do
    grep -Fqx $_sh /etc/shells || echo $_sh >>/etc/shells
  done
}

post_upgrade() {
  post_install
}

post_remove() {
  sed -i -r '/^(\/usr)?\/bin\/[oy]sh$/d' etc/shells
}
