#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/webconf-cert - Create Webconf Certificate # # Creation: 07.03.2002 chriswue # Last Update: $Id$ # # Copyright (c) 2002-2004 Frank Meyer # # 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. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib clrhome mecho -info "create new certificate for webconf" echo /etc/init.d/webconf stop echo cert="/var/config/mini_httpd.pem" certconf="/usr/local/webconf/mini_httpd.cnf" # create certificate echo "The ssl-certifcate for the web-configuration is now created." echo # run interactive or not? if [ `get_printmode` = "tty" ] then mecho -warn "Please answer the following questions carefully." mecho -warn "You are asked only once." echo /usr/bin/openssl req -new -x509 -days 365 -nodes \ -config $certconf -out $cert -keyout $cert echo else /usr/bin/openssl req -new -x509 -days 365 -nodes -batch \ -config $certconf -out $cert -keyout $cert fi # check certificate echo "check certificate settings" /usr/bin/openssl x509 -subject -dates -fingerprint -noout -in $cert chmod 600 $cert echo /etc/init.d/webconf start echo anykey exit 0