-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharreglar-ssl-vestacp.sh
More file actions
33 lines (27 loc) · 1.01 KB
/
Copy patharreglar-ssl-vestacp.sh
File metadata and controls
33 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#################################################
######### Script regenerar SSL VestaCP ##########
####### RaiolaNetworks raiolanetworks.es ########
#################################################
## Variables a modificar
#Email admin
$email="correo@dominio.es"
#Direcotrio VestaCP
$VESTA="/usr/local/vesta"
##################################
############ NO TOCAR ############
##################################
# Generamos el SSL nuevo
$VESTA/bin/v-generate-ssl-cert $(hostname) $email 'ES' 'Lugo' \
'Lugo' 'Raiola Networks' 'IT' > /tmp/vst.pem
# Genrramos los ficheros finales
crt_end=$(grep -n "END CERTIFICATE-" /tmp/vst.pem |cut -f 1 -d:)
key_start=$(grep -n "BEGIN RSA" /tmp/vst.pem |cut -f 1 -d:)
key_end=$(grep -n "END RSA" /tmp/vst.pem |cut -f 1 -d:)
# Agregamos el SSL
cd /usr/local/vesta/ssl
sed -n "1,${crt_end}p" /tmp/vst.pem > certificate.crt
sed -n "$key_start,${key_end}p" /tmp/vst.pem > certificate.key
chown root:mail /usr/local/vesta/ssl/*
chmod 660 /usr/local/vesta/ssl/*
rm /tmp/vst.pem