# rpm -q --scripts zsh
\postinstall scriptlet (using /bin/sh):
if [ "$1" = 1 ]; then
if [ ! -f /etc/shells ] ; then
echo "/usr/bin/zsh" > /etc/shells
echo "/bin/zsh" >> /etc/shells
else
grep -q "^/usr/bin/zsh$" /etc/shells || echo "/usr/bin/zsh" >> /etc/shells
grep -q "^/bin/zsh$" /etc/shells || echo "/bin/zsh" >> /etc/shells
fi
fi
if [ -f /usr/share/info/zsh.info.gz ]; then
# This is needed so that --excludedocs works.
/sbin/install-info /usr/share/info/zsh.info.gz /usr/share/info/dir \
--entry="* zsh: (zsh). An enhanced bourne shell."
fi
preuninstall scriptlet (using /bin/sh):
if [ "$1" = 0 ] ; then
if [ -f /usr/share/info/zsh.info.gz ]; then
# This is needed so that --excludedocs works.
/sbin/install-info --delete /usr/share/info/zsh.info.gz /usr/share/info/dir \
--entry="* zsh: (zsh). An enhanced bourne shell."
fi
fi
postuninstall scriptlet (using /bin/sh):
if [ "$1" = 0 ] && [ -f /etc/shells ] ; then
sed -i '\!^/usr/bin/zsh$!d' /etc/shells
sed -i '\!^/bin/zsh$!d' /etc/shells
fi