#!/bin/sh

case "$1" in
 remove)
 # Restore default shell for accounts, if needed
 getent passwd | grep -q "^root:.*:/bin/bash4" && ( chsh -s /bin/sh root || exit 1 )
 getent passwd | grep -q "^user:.*:/bin/bash4" && ( chsh -s /bin/sh user || exit 1 )

 # Remove /bin/bash4 from /etc/shells
 if grep -q "/bin/bash4" /etc/shells 2>/dev/null; then
  tmpf=`mktemp "/tmp/__bash4.XXXXXX"`
  grep -v "/bin/bash4" /etc/shells >$tmpf && mv -f $tmpf /etc/shells
  rm -f $tmpf
 fi

 ;;
esac

#DEBHELPER#
