echo 'Removing old certificates'
cd /certs
mv /certs/*.crt /certs/old/
mv /certs/*.key /certs/old/
mv /certs/*.pem /certs/old/
echo 'Downloading new certificates'
wget http://home.lungu.net/bp/letsencrypt/fullchain6.pem
wget http://home.lungu.net/bp/letsencrypt/privkey6.pem
echo 'Renaming certificates'
mv fullchain6.pem fullchain.pem
mv privkey6.pem privkey.pem
echo 'Removing expired certificates'
mv /binance-to-google-sheets-proxy/priv/ssl/*.pem /binance-to-google-sheets-proxy/priv/ssl/old/
echo 'Copying new certificates'
cp /certs/privkey.pem /binance-to-google-sheets-proxy/priv/ssl/
cp /certs/fullchain.pem /binance-to-google-sheets-proxy/priv/ssl/
echo 'All done!'
