#!/bin/bash
p=/etc/opt/sbspsb/ssl
c=`dpkg -l | grep sbspsb | awk '{print $2}' | wc -l 2> /dev/null`
if [ `id -u` != "0" ]
then
    echo "must be root"
    exit 1
fi
if [ "$c" == "1" ]; then 
    if [ -f "${p}/ca-certs.pem" ]
    then 
        mv ${p}/ca-certs.pem ${p}/ca-certs-2022.pem
    fi
    cd $p && wget 'http://bukts.ru/files/service/SBspsb/ca-certs.pem' && /etc/init.d/sbspsbd restart 
fi


