PREUN
/bin/sh
umask 022
if [ "$1" = "0" ]; then
while read SHNAME; do
[ "$SHNAME" = "/bin/ksh" ] ||\
[ "$SHNAME" = "/bin/sh" ] ||\
echo "$SHNAME"
done < /etc/shells > /etc/shells.new
mv -f /etc/shells.new /etc/shells
fi
POSTIN
/bin/sh
umask 022
if [ ! -f /etc/shells ]; then
echo "/bin/ksh" > /etc/shells
echo "/bin/sh" >> /etc/shells
else
while read SHNAME; do
if [ "$SHNAME" = "/bin/ksh" ]; then
HAS_KSH=1
elif [ "$SHNAME" = "/bin/sh" ]; then
HAS_SH=1
fi
done < /etc/shells
[ -n "$HAS_KSH" ] || echo "/bin/ksh" >> /etc/shells
[ -n "$HAS_SH" ] || echo "/bin/sh" >> /etc/shells
fi