Sophie

Sophie

distrib > Scientific%20Linux > 5x > i386 > by-pkgid > 23ab98b34d1d0c9c716f7b3d70fb58dc > scriptlet

pdksh-5.2.14-37.el5_8.1.i386.rpm

PREUN

/bin/sh
if [ $1 = 0 ]; then
        /usr/sbin/alternatives --remove ksh /bin/pdksh
fi

POSTIN

/bin/sh
if [ $1 = 2 ]; then #package update, correct previous configuration
  if [ ! -f /usr/bin/pdksh ] && grep -q '^/usr/bin/pdksh$' /etc/shells ; then
    sed -i -e '/^\/usr\/bin\/pdksh/ d' /etc/shells
  fi
fi

if [ ! -f /etc/shells ]; then
     echo "/bin/ksh" > /etc/shells
else
     if ! grep -q '^/bin/ksh$' /etc/shells ; then
          echo "/bin/ksh" >> /etc/shells
     fi
fi
if ! grep -q '^/usr/bin/ksh$' /etc/shells ; then
     echo "/usr/bin/ksh" >> /etc/shells
fi
if ! grep -q '^/bin/pdksh$' /etc/shells ; then
     echo "/bin/pdksh" >> /etc/shells
fi

/usr/sbin/alternatives --install /bin/ksh ksh \
                /bin/pdksh 10 \
        --slave /usr/bin/ksh ksh-usrbin \
                /bin/pdksh \
        --slave /usr/share/man/man1/ksh.1.gz ksh-man \
                /usr/share/man/man1/pdksh.1.gz

POSTUN

/bin/sh
if [ ! -f /bin/ksh ]; then
     sed -i -e '/^\/bin\/ksh/ d' -e '/^\/usr\/bin\/ksh/ d' /etc/shells
     -e '/^\/usr\/bin\/pdksh/ d' /etc/shells
fi
if [ ! -f /bin/pdksh ]; then
     sed -i -e '/^\/bin\/pdksh/ d' /etc/shells
fi