true
# Не исполнять preremove и postremove скрипт в rpm при upgrade
#! test -r /etc/debian_version && test "$1" -eq 1 && exit 0
test -h /usr/share/man/man8/certmgr.8 && rm -f /usr/share/man/man8/certmgr.8
test -h /usr/share/man/ru/man8/certmgr.8 && rm -f /usr/share/man/ru/man8/certmgr.8

# есть надежда, что так мы не затрём маны оригинального stunnel
test -h /usr/share/man/man8/stunnel.8 && rm -f /usr/share/man/man8/stunnel.8
test -h /usr/share/man/ru/man8/stunnel.8 && rm -f /usr/share/man/ru/man8/stunnel.8

if test -z "#" && test -f /etc/cron.daily/cprocsp;then
    rm -f /etc/cron.daily/cprocsp
else
    crontab -l |fgrep -v '/etc/init.d/cprocsp' > /tmp/crontab.tmp
    crontab /tmp/crontab.tmp
fi

/etc/init.d/cprocsp stop_check force
/etc/init.d/cprocsp stop

if test -z "#";then
    test -r /etc/debian_version && debian=1
    if test -n "$debian" && test -f /usr/sbin/update-rc.d;then
      /usr/sbin/update-rc.d cprocsp remove
    elif test -f /usr/lib/lsb/remove_initd;then
      /usr/lib/lsb/remove_initd /etc/init.d/cprocsp
    elif test -f /sbin/chkconfig;then
      /sbin/chkconfig --del cprocsp
    elif test -f /usr/sbin/update-rc.d; then
      /usr/sbin/update-rc.d cprocsp remove
    else
      for i in 2 3 4 5;do
	rm /etc/rc.d/rc$i.d/S50cprocsp
      done
      for i in 0 1 6;do
	rm /etc/rc.d/rc$i.d/K60cprocsp
      done
    fi
    true
fi

rm -f /etc/init.d/cprocsp /etc/rc2.d/S25cprocsp
#rm /etc/rc.d/cprocsp

true

