aboutsummaryrefslogtreecommitdiffstats
path: root/lfacme-setup.sh
diff options
context:
space:
mode:
authorLexi Winter <ivy@FreeBSD.org>2025-06-03 09:53:49 +0100
committerLexi Winter <ivy@FreeBSD.org>2025-06-03 09:53:49 +0100
commit6e4bfc59487dbb9d5c80d2debe98f769fe244577 (patch)
tree24f9386619f6068925e037b4254859acc0ecc0e0 /lfacme-setup.sh
parent65401ae5872e76f5ceab0c0e808d1e4823c6c0dc (diff)
downloadlfacme-6e4bfc59487dbb9d5c80d2debe98f769fe244577.tar.gz
lfacme-6e4bfc59487dbb9d5c80d2debe98f769fe244577.tar.bz2
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.
Diffstat (limited to 'lfacme-setup.sh')
-rw-r--r--lfacme-setup.sh27
1 files changed, 25 insertions, 2 deletions
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