#!/bin/sh gen_nginx_acme_conf(){ domain=$1 alt_domain=$2 nginx_conf_file="/etc/nginx/sites-enabled/$domain" [ ! -f $nginx_conf_file ] || rm $nginx_conf_file; mkdir /var/www/htdocs/$domain rcctl check nginx if [ $? == 0 ]; then cat > $nginx_conf_file <> $acme_conf_file <> $acme_conf_file < /tmp/acme-client.conf cp -v /etc/acme-client.conf /etc/acme-client.conf.old cp -v /tmp/acme-client.conf /etc/acme-client.conf } install_utils(){ cp -v utils/renew_https_certificate /usr/local/bin/renew_https_certificate chmod u+x /usr/local/bin/renew_https_certificate } get_certificate() { domain=$1 /usr/local/bin/renew_https_certificate $domain } usage() { print "This program ask 3 arguments : \n" print "First is email with domain name the second is list of alternatives domains with \" \" \n" print "the last arguments is for share the ssl cert with xmpp daemon add xmpp at the end or not" print "\t $0 domain.tld \"a.domain.tld b.domain.tld c.domain.tld\"" } if [ -z $1 ]; then usage exit 3; fi domain=$1 alt_domain=$2 gen_nginx_acme_conf $domain