-# izgenerirati certifikate
-cert="postfix" # basename of certificate
-description="Postfix SMTP daemon" # descriptive text
-cd /etc/ssl/certs
-PATH=$PATH:/usr/bin/ssl
-if [ -f "$cert.pem" ]; then
- echo "CN: You already have /etc/ssl/certs/$cert.pem"
-else
- echo "CN: Creating generic self-signed certificate: /etc/ssl/certs/$cert.pem"
- echo "CN: (replace with hand-crafted or authorized one if needed)."
- HOSTNAME=`hostname -s`
- FQDN=`hostname -f`
- openssl req -new -x509 -days 365 -nodes -out "$cert.pem" -keyout "$cert.pem" > /dev/null 2>&1 <<+
-.
-.
-.
-$description
-$hostname
-$fqdn
-root@$mailname
-+
- ln -sf "$cert.pem" `openssl x509 -noout -hash < "$cert.pem"`.0
- chown root.root "/etc/ssl/certs/$cert.pem"
- chmod 0640 "/etc/ssl/certs/$cert.pem"
-fi
-