#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/inet-create-cert - create (new) certificate for pure-ftpd # # Copyright (c) 2001-2004 Ansgar Püster # # Creation: 30.10.2004 ap # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- #------------------------------------------------------------------------------- # check if package having an appropriate version is installed #------------------------------------------------------------------------------- package_exists() { VAL=$(/var/install/bin/check-version $1 $2) [ "$VAL" = 'installed' -o "$VAL" = 'old' ] && return 0 || return 1 } # include eislib . /var/install/include/eislib certconf='/usr/local/ssl/openssl.cnf' certfile='/usr/local/ssl/certs/pure-ftpd.pem' certspackage=certs certsversion='1.0.5' clrhome mecho -info "Create (new) certificate for pure-ftpd" mecho if package_exists $certspackage $certsversion then /usr/bin/openssl req -x509 -newkey rsa:1024 -days 365 -nodes \ -config $certconf -out $certfile -keyout $certfile chmod 600 $certfile mecho mecho -warn "Attention:" mecho -warn "You have to restart pure-ftpd to activate the new certificate." mecho else mecho -error "Unable to create (new) certificate for pure-ftpd." mecho -error "Package certs (TLS certificate management) Version $certsversion" mecho -error "or higher is missing." mecho -error "Please install a package having an appropriate version an try again." fi anykey