#!/bin/sh -e # # debconf config for #PACKAGE# # Source debconf library. . /usr/share/debconf/confmodule db_version 2.0 # This conf script is capable of backing up db_capb backup # set default vaules db_set sipxcommserverlib/countryName EU db_set sipxcommserverlib/stateOrProvinceName Province db_set sipxcommserverlib/localityName Locality db_set sipxcommserverlib/organizationName Organization db_set sipxcommserverlib/serverHostName `hostname --fqdn` db_set sipxcommserverlib/commonName_CA ca.`hostname --domain` db_set sipxcommserverlib/emailAddress_CA root@ca.`hostname --domain` db_set sipxcommserverlib/emailAddress_server root@`hostname --fqdn` db_set sipxcommserverlib/sipDomainName `hostname --domain` db_set sipxcommserverlib/serverHostName `hostname --fqdn` STATE=1 while [ "$STATE" != 0 -a "$STATE" != 12 ]; do case "$STATE" in 1) db_title Generate self-signed SSL key and cert - 1 of 10 db_input high sipxcommserverlib/commonName_CA || true ;; 2) db_title Generate self-signed SSL key and cert - 2 of 10 db_input high sipxcommserverlib/serverHostName || true ;; 3) db_title Generate self-signed SSL key and cert - 3 of 10 db_input high sipxcommserverlib/sipDomainName || true ;; 4) db_title Generate self-signed SSL key and cert - 4 of 10 db_input high sipxcommserverlib/emailAddress_CA || true ;; 5) db_title Generate self-signed SSL key and cert - 5 of 10 db_input high sipxcommserverlib/emailAddress_server || true ;; 6) db_title Generate self-signed SSL key and cert - 6 of 10 db_input high sipxcommserverlib/countryName || true ;; 7) db_title Generate self-signed SSL key and cert - 7 of 10 db_input high sipxcommserverlib/stateOrProvinceName || true ;; 8) db_title Generate self-signed SSL key and cert - 8 of 10 db_input high sipxcommserverlib/localityName || true ;; 9) db_title Generate self-signed SSL key and cert - 9 of 10 db_input high sipxcommserverlib/organizationName || true ;; 10) db_title Generate self-signed SSL key and cert - 10 of 10 db_input high sipxcommserverlib/organizationalUnitName || true ;; 11) # Check if commonName_CA and serverHostName are not the same db_get sipxcommserverlib/commonName_CA commonName_CA=$RET db_get sipxcommserverlib/serverHostName serverHostName=$RET if [ $commonName_CA = $serverHostName ]; then db_fset sipxcommserverlib/commonName_CA seen false || true db_fset sipxcommserverlib/serverHostName seen false || true db_fset sipxcommserverlib/serverHostNameequalcommonNameCA seen false || true db_input high sipxcommserverlib/serverHostNameequalcommonNameCA || true db_set sipxcommserverlib/serverHostName `hostname --fqdn` STATE=0 fi ;; esac if db_go; then STATE=$(($STATE + 1)) else STATE=0 fi done db_go SSL_DEFAULTS=/etc/sipxpbx/ssl/SSL_DEFAULTS echo # Values set by sipxcommserverlib. >> $SSL_DEFAULTS echo # For non-interactive use with /usr/lib/sipx/ssl-cert/gen-ssl-keys.sh >> $SSL_DEFAULTS db_get sipxcommserverlib/countryName echo countryName=$RET >> $SSL_DEFAULTS db_get sipxcommserverlib/stateOrProvinceName echo stateOrProvinceName=$RET >> $SSL_DEFAULTS db_get sipxcommserverlib/localityName echo localityName=$RET >> $SSL_DEFAULTS db_get sipxcommserverlib/organizationName echo organizationName=$RET >> $SSL_DEFAULTS db_get sipxcommserverlib/serverHostName echo organizationalUnitName=$RET >> $SSL_DEFAULTS db_get sipxcommserverlib/commonName_CA echo caName=$RET >> $SSL_DEFAULTS db_get sipxcommserverlib/emailAddress_CA echo caEmail=$RET >> $SSL_DEFAULTS db_get sipxcommserverlib/emailAddress_server echo serverEmail=$RET >> $SSL_DEFAULTS db_get sipxcommserverlib/sipDomainName echo sipDomainName=$RET >> $SSL_DEFAULTS db_get sipxcommserverlib/serverHostName echo server=$RET >> $SSL_DEFAULTS # script looks for SSL_DEFAULTS in . cd /etc/sipxpbx/ssl /usr/lib/sipx/ssl-cert/gen-ssl-keys.sh -d > /dev/null 2>&1 /usr/lib/sipx/ssl-cert/install-cert.sh > /dev/null 2>&1 #DEBHELPER#