From 6e4bfc59487dbb9d5c80d2debe98f769fe244577 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Tue, 3 Jun 2025 09:53:49 +0100 Subject: improve path handling - allow a different configuration directory to be specified with '-c' - since acme.conf allows the uacme directory to be changed, this allows the user to change both. - use /var/db/lfacme as the default datadir instead of putting data in /etc. --- lfacme-setup.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'lfacme-setup.sh') diff --git a/lfacme-setup.sh b/lfacme-setup.sh index c2a0798..90c1160 100644 --- a/lfacme-setup.sh +++ b/lfacme-setup.sh @@ -1,8 +1,31 @@ #! /bin/sh # This source code is released into the public domain. +# Parse command-line arguments. +args=$(getopt c:vy $*) +if [ $? -ne 0 ]; then + exit 1 +fi +set -- $args + +_uacme_flags="" + +while :; do + case "$1" in + -c) + _CONFDIR="$2" + shift; shift;; + -v|-y) + _uacme_flags="$_uacme_flags $1" + shift;; + --) + shift; break;; + esac +done + +# Initialise. . /usr/local/share/lfacme/init.sh +# Run uacme. mkdir -p "$_UACME_DIR" - -_uacme new +_uacme $_uacme_flags new -- cgit v1.2.3